title: Sorting files by creation/modification date in PHP
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2084986/file-creation-time">File creation time</a>  </p>
  </blockquote>
  
  
  
  <p>In PHP, how to retrieve the files contained into a folder sorted by creation date (or any other sorting mechanism)?</p>
  
  <p><a href="http://uk3.php.net/manual/en/function.readdir.php" rel="nofollow noreferrer">According to the doc</a>, the <em>readdir()</em> function:</p>
  
  <blockquote>
    <p>The filenames are returned in the
    order in which they are stored by the
    filesystem.</p>
  </blockquote>