I am new to PHP and developing a project called BaboonHut.com, I am coding it in PHP as the best way to learn is by just diving in. Anyway to the question, the snippet of code b
You can't beat DirectoryIterator.
$files = array();
$dir = new DirectoryIterator('.');
foreach ($dir as $fileinfo) {
// Add only directories into a associative array, that key is it `MTime`
if($fileinfo->isDir()){
$files[$fileinfo->getMTime()] = $fileinfo->getFilename();
}
}
// Then, key sort it.
ksort($files);