Hi All,
I have a list of PDF's in a folder that I want to offer as downloads.
I have a simple read directory script that gets all the files in the folder and displays them as links.
The problem is that they are not ordered as I would like.
I'm not even sure what order they are in.
It doesn't seem to be alpabetically, upload order or file creation date order.
Any suggestions for ordering these files would be appreciated.
Many Thanks
<?
$dir_open = "PDF Catalogues/".$brand."";
if($dir = opendir($dir_open))
{
while (($file = readdir($dir)) !== false)
{
if($file != "." && $file != "..")
{
$file_size = filesize("PDF Catalogues/".$brand."/".$file);
$sizemb = round(($file_size/1024),1);
echo "<a href=\"".$dir_open."/".$file."\" target=\"new\">$file</a> (".$sizemb." kb) <br>";
}
}
closedir($dir);
}