Codice PHP:
$file = glob("*.*");
function ordina($file1,$file2) {
$tempo1 = filectime($file1);
$tempo2 = filectime($file2);
return ($tempo1 < $tempo2) ? 1 : -1;
}
usort($file,'ordina');
$file = array_slice($file,0,5);
echo '<pre>';
print_r($file);
echo '</pre>';