title: PHP - display 'X' items from foreach loop with link to display next 'X' items
body: <p>I have a foreach loop which loops through an array (simpleXML nodes). This array can have between 0 and several hundred items in it. I'd like to find a way to display the first 10 results and then have a link to display the next 10 and so on.</p>
  
  <p>for instance, I currently have:</p>
  
  <pre><code>$i=0;
  $limit=10;
  foreach ($nodes as $node){
  echo "here is the output: ".$node."&lt;br&gt;\n";
  if (++$i &gt;=$limit) break;
  }
  </code></pre>
  
  <p>obviously, no matter how many items are in the $nodes array, it only displays the first 10. But I think I read that foreach loops reset the counter every time they run - so if I wanted to have a link that said: <code>next 10 itmes</code> - I'm not sure how I would tell the the loop to start on index=10.</p>
  
  <p>Am I even barking up the right tree here? </p>