I have this simple code that displays a list of files from a directory
<?php
$dir = opendir("pages");
while (($file = readdir($dir)) !== false)
{
if($file !="." AND $file !=".."){
echo "<a href=\"show_page.php?file=" .$file . "\">".$file."</a>";
echo "<br />";
}
}
closedir($dir);
?>
Can anyone please help edit this code to order the list displayed by date modified?