<?php
for ($i = 1; $i<=$pages_item; $i++) {
echo "<tr><td>Page ".$i."</td></tr>";
}
foreach ($array_item as $item) {
echo "<tr class=link onclick=window.location.href='item.php?
id=".$item[$item_id]."'>";
}
?>
I am creating pages from a MySQL query in PHP with CSS instead of javascript. The page system works.
What I need is to be able to limit the foreach loop, like for every page in the for loop, I want a foreach loop to go through my array at a specific start and end point.
I would like to have it like this
for every page do
for every item start here and ending here do
do magic
increase start here
increase ending here
done
I need to have it display 50 results per page from the foreach loop within the for loop. I've seen array slicing but that will only set a start point and doesn't really do what I want.