How can i do paging in php?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
dharprog
Forum Contributor
Posts: 126
Joined: Fri Oct 27, 2006 12:20 am

How can i do paging in php?

Post by dharprog »

Hi,

How can i do paging in php for foreach loop?

Thank YOu
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

There's millions of paging solutions that have been posted before. Try searching.
User avatar
dharprog
Forum Contributor
Posts: 126
Joined: Fri Oct 27, 2006 12:20 am

Ya u r right But...

Post by dharprog »

HI,

ya U r right But here the thing is for forloop how can i do cos we can do for records coming from database by using offset and or limit but how can we do here for array type elements if they are lot more to limit in the page.

Thank You...
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

You can use array_slice on an array with similar effects as LIMIT has on a mysql query result.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Re: Ya u r right But...

Post by timvw »

dharprog wrote:HI,

ya U r right But here the thing is for forloop how can i do cos we can do for records coming from database by using offset and or limit but how can we do here for array type elements if they are lot more to limit in the page.

Thank You...
Then you should improve your search query... Even the search button on my blog returns valid results :P
Post Reply