I am working on a script that will display all files and make links in a giving directory, but i want the most recently uploaded to be at the top of the list. I have searched through this site looking for an answer or a similar question but came up with nothing.
Here is the code I have so far:
<?php
$dir = opendir('files/');
while ($read = readdir($dir))
{
if ($read!='.' && $read!='..')
{
echo '<ul style="list-style: none;"><li><a href="files/'.$read.'"target="_blank"><FONT COLOR="#0196e3">'.$read.'</a></li></ul>';
}
}
closedir($dir); ?>
I would appreciate any help or suggestions.