I found a tutorial for making LAST/NEXT links, and while the tutorial itself didn't work (too many typos I think), I managed to convert it to my own needs relatively easily. So while it's working now, there's one part in the code that I don't quite get, which annoys me, so maybe someone here can explain it.
The script makes LAST/NEXT links and also makes links for the in-between pages, and it's the code around those pages that has me slightly puzzled. Specifically:
// calculate number of pages needing links
$pages=intval($numrows/$limit);
This bit takes the total number of rows and divides it by the limit per page I've set. This makes sense to me.
// $pages now contain int of pages needed unless there is a remainder from division
if ($numrows%$limit) {
// has remainder so add one page
$pages++;
}
This, I beleive ensures that any remainders from the first calculation get turned into a whole number. So if the first calculation produced 8.35 as an answer, it would get rounded up to 9. ('Cause having 8.35 in-between links isn't really possible.) So assuming I'm right with that, what is making that work? What does the % symbol do? I've tried to look this up at php.net, but it's turning out to be difficult to successfully look up "%" on any search engine. 🙁 Any ideas?
Thanks.