Codice PHP:<?php
if ($handle = opendir('font/')) {
$i = 0;
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$i++;
$file_list[$i] = $file;
}
}
closedir($handle);
// Ordinamento
print '<pre>';
echo "Ordinamento standard\n";
sort($file_list);
print_r($file_list);
print '</pre>';
//----
print '<pre>';
echo "\nOrdinamento naturale\n";
natsort($file_list);
print_r($file_list);
print '</pre>';
}
?>

Rispondi quotando