php thumbnail organizer <p>Ok, i have this code and is working perfectly, but i need the order of the images to be by the date the image was created, can someone give me a hand?</p> <pre><code>$images=array(); $dir = @opendir('.') or die("Unable to open $path"); $i=0; while($file = readdir($dir)) { if(is_dir($file)) continue; else if($file != '.' &amp;&amp; $file != '..' &amp;&amp; $file != 'index.php') { $images[$i]=$file; $i++; } } sort($images); for($i=0; $i&lt;sizeof($images); $i++) { echo "&lt;a href=".chr(34).$path.$images[$i].chr(34)."&gt;&lt;img style='border:1px solid #666666; width:200px; margin: 10px;' src='".$images[$i]."'/&gt;&lt;/a&gt;"; } closedir($dir); </code></pre>