I am trying to do what I thought would be simple but is turning into a real headache. Currently we have classic ASP pages that read all the files in a directory and output those to a webpage sorted by date. I have tried several different methods and have been able to get the files and dates and output them to the page but so far I have had no success in getting the records sorted. Here is my current version:
$files = scandir($dir);
foreach($files as $file){
if($file != "." && $file != ".."){
if (!is_dir("myFolder/$file")){
echo $file . "<br />";
echo date("d-m-Y", filemtime($dir. "\\" . $file)) . "<br />";
}
}
}
Normally I was using a 2D array and storing the filename in one field and modified date in the other but with the method I believe it is just storing the data of the file and I can read the result from that field. I have no specific reason for doing it one way or the other. I haven't been able to get either to work.