$dir = 'fotos/';
$type = 'jpg';
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
$ext = explode('.', $file);
if($type == 'jpg'){ //read all the php files
if($file != '.' && $file != '..' && $ext[1] == $type){
print "
\n";
}
}
}
closedir($dh);
}
}
?>