Hello everyone.
I am new to this forum.
I'm not sure how I'd paginate an array. I've worked out the $start and $limit. But I'm just not sure how I'd put that into my foreach loop.
May I stress that I've already handled displaying the links to the page etc.
All I need to do is implement pagination into an array of data.
Here's an example of my situation.
PHP Code:
if($got_item_run = mysql_query($get_items_q)){
if($item_data = mysql_fetch_assoc($got_item_run)) {
$item_list = $item_data['catalog_items'];
$items2 = explode(',',$item_list);
$hasItem = false;
foreach($items as $curr_item) {
$curr_items = explode('&', $curr_item);
$array_length = count($curr_items);
if($array_length>=2) {
I've made a pagination with mySQL because the "LIMIT" handled a lot of it. But you can't simply put "LIMIT $start, $limit" in a foreach loop.
I hope you understand my question.
Examples of your method of paginating an array in this situation would be appreciated.
Thank you.