I think you mean, how do you split results into like 5 pages, instead of showing them all on one ?
If so, then use / operator to find out how many pages are needed.
IE, if you have 20 results and 6 per page.
20 / 6 = 3 (divides 3 times exactly).
20 % 6 = 2 (ie, remainder 2).
So you need 3 pages of 6 results, and 1 page with 2 results.