title: Sort Files By Modification Time in PHP
body: <p>So my current code:</p>
  
  <pre><code>$path = 'C:\\movies';
  $d = dir($path);
  $movies = array();
  $movietimes = array();
  while (false !== ($entry = $d-&gt;read()))
  {
      if($entry !== '.' AND $entry !== '..')
      {
          $stat = stat($path.'\\'.$entry);
          $movietimes[] = $stat['ctime'];
          $movies[] = $entry;
      }
  }
  $d-&gt;close();
  natsort($movietimes);
  $movietimes = array_reverse($movietimes, true);
  foreach($movietimes as $k=&gt;$v)
  {
      echo $movies[$k];
  }
  </code></pre>
  
  <p>However now I want to be able to access three at a time.
  Any ideas?</p>