Page 1 of 1

How can i do paging in php?

Posted: Wed Nov 01, 2006 6:22 am
by dharprog
Hi,

How can i do paging in php for foreach loop?

Thank YOu

Posted: Wed Nov 01, 2006 6:24 am
by onion2k
There's millions of paging solutions that have been posted before. Try searching.

Ya u r right But...

Posted: Wed Nov 01, 2006 6:45 am
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...

Posted: Wed Nov 01, 2006 8:00 am
by volka
You can use array_slice on an array with similar effects as LIMIT has on a mysql query result.

Re: Ya u r right But...

Posted: Wed Nov 01, 2006 12:16 pm
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