Perchè questo codice non mi mostra le immagini in ordine alfabetico, ma in ordine di caricamento sul server?
Codice PHP:
if ($handle = opendir('./images/big/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$strImmagine = substr($file,0,strlen("sito_".strtolower($strPagina)));
if ($strImmagine == "sito_".strtolower($strPagina)){
echo '[img]images/big/'.$file.'[/img]
';
}
}
}
closedir($handle);
}