This question is relevant for a lightweight pagination script I am busy writing.
I have the total items and the page limit for every page. for example 15 items in total but I would like to paginate on 10. This means there are 2 pages. How do I get to that using a formula?
I am using ceil( $total / $page_limit ) at the moment is that right?
Yes, it is. If there is nothing to round (e.g. if the outcome is not a float) it will simply return the outcome. If the outcome is a float, it will round it up (next highest integer value), so you’ll have one page with less items than the rest, but that shouldn’t be an issue.