title: Split foreach to pages
body: <pre><code>$files = glob('docs/*.xml');
   foreach($files as $file){
   $xml = new SimpleXMLElement($file, 0, true);
   echo'
   &lt;tr&gt;
   &lt;td&gt;' . $xml-&gt;doctype . '&lt;/td&gt;
   &lt;td&gt;&lt;a href="viewdoc.php?docname=' . basename($file, '.xml') . '&amp;username='. $xml-&gt;startedby .'&amp;myname='. $_SESSION['username'] .'"&gt;' . basename($file, '.xml') . '&lt;/a&gt;&lt;/td&gt;
   &lt;td&gt;&lt;a href="viewprofile.php?name='. $xml-&gt;startedby .'"&gt;'. $xml-&gt;startedby .'&lt;/a&gt;&lt;/td&gt;
   &lt;td&gt;'. $xml-&gt;date .'&lt;/td&gt;
   &lt;td&gt;* * * * *&lt;/td&gt;
   &lt;td&gt;&lt;/td&gt;
   &lt;/tr&gt;
   ';
  }
  </code></pre>
  
  <p>The code above is a loop that show me all files in docs folder.
  I wish to have only 10 xml files in 1 page and split every page anouter 10 files.
  How can I do that?</p>