File: /var/www/html/www.uscornatese.it/2010_2011/tutte/index.php
<?php
$files = scandir("./");
for ($i=0; $i<count($files); $i++)
{
$image = $files[$i];
$supported_file = array(
'gif',
'jpg',
'jpeg',
'png'
);
$ext = strtolower(pathinfo($image, PATHINFO_EXTENSION));
if (in_array($ext, $supported_file)) {
echo basename($image)."<br />"; // show only image name if you want to show full path then use this code // echo $image."<br />";
echo '<a href="'.$image .'" target="_foto_' . $i . '"><img style="width:400px;" src="'.$image .'" /></a>'."<br /><br />";
} else {
continue;
}
}
?>