I have a coding in which a directory files are listed with the help of following array.
$handle=@opendir($listdir);
if (!$handle) { echo "no directory ('.$listdir.'), dying."; exit(); }
while (($file = readdir($handle))!==false) {
$filearray[count($filearray)] = $file;
asort($filearray); closedir($handle);
Instead of using built in sorting functions to sort files by name, I want to sort files by files date (Date format "F j Y h:i:s A"). Please help me to deal with my problem.