Se i file presenti sono tutti di tipo immagine, potresti usare la funzione getimagesize() nel ciclo di WHILE.
Così dovrebbe andare.Codice PHP:
<?php
$tipo = "image/gif"; // avevi sbagliato a scrivere il tipo MIME
$dir = "nome_cartella"; // CARTELLA DOVE RISIEDONO I FILE
$handle = opendir($dir);
$totale=0;
echo "[list=1]";
while ($file = readdir($handle)) {
if ($file != "." && $file != "..") {
$info = getimagesize("$dir/$file");
$size = $info['mime'];
if ($size == $tipo) {
$icona = "<img =\"icona_gif.gif\" />";
} else {
$icona = "";
}
echo "[*]$icona $file";
$totale++;
}
}
echo"[/list]
<hr />$totale file presenti nella cartella!";
closedir($handle);
?>
![]()