I'm building a webpage where the items listed in the webpage are dynamic, (The items are loaded from the database.) Say we have 19 items in the database. The maximum items allowed for a page is 4. Now I have 15 items remaining. I need the rest of the items in another 4 pages.
Like this --> Pg1 -> 4 items displayed
Pg2 -> 4 items displayed
Pg3 -> 4 items displayed
Pg4 -> 3 items displayed
As shown above my php code needs to identify the number of items and the number of pages required. What is the best way you would suggest me to do this.