limit and offset foreach loops
<p>Say i want to loop through XML nodes but i want to ignore the first 10 and then limit the number i grab to 10.</p>

<pre><code>$limit=10; //define results limit
$o=20; //define offset
$i=0; //start line counter

foreach($xml-&gt;id AS $key =&gt; $value){
 $i++;
 if($i &gt; $o){
 //if line number is less than offset, do nothing.
 }else{ 
 if($i == "$limit"){break;} //if line is over limit, break out of loop
 //do stuff here
 }
}
</code></pre>

<p>So in this example, id want to start on result 20, and only show 10 results, then break out of the loop. Its not working though. Any thoughts?</p>
