Sorting files by creation/modification date in PHP
<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">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>
