Si te interesa orientado a objetos puedes hacer uso de FileSystemIterator:
Código PHP:
Ver original$iterable = new FilesystemIterator
(dirname(__FILE__)); foreach ($iterable as $fileinfo) {
if(!$fileinfo->isDir()){
$array[$fileinfo->getMTime()] = $fileinfo->getFilename();
}
}
foreach($array as $k => $v){
$date = new DateTime();
$date->setTimestamp($k);
echo "{$date->format('Y-m-d')} --> $v" .'<br>';
}