danscreations Posted August 21, 2008 Share Posted August 21, 2008 I have an array that prints results out on the page but was curious if anyone knew how to specifiy a certain amount of records to print before creating a link to page two which would specify to display the next set of records. Example: - data file contains 25 records - want to display 10 records per page page 1: print records 0 thru 9 page 2: print records 10 thru 19 page 3: pring records 20 thru 24 obviously needs be based on a varible so that if they're are only 7 records or 48 it will figure out how many pages need to be created/displayed. Quote Link to comment https://forums.phpfreaks.com/topic/120721-display-array-in-multipule-pages/ Share on other sites More sharing options...
JonnoTheDev Posted August 21, 2008 Share Posted August 21, 2008 Count the number of records. Divide by the number of records to show on each page to get the number of pages: use ceil(); Use the array offsets to determine which value to start at and end with for each page. The URL parameter to determine the page could be the starting offset. Work with that. Quote Link to comment https://forums.phpfreaks.com/topic/120721-display-array-in-multipule-pages/#findComment-622127 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.