Codice PHP:
$str '';
if (
$handle opendir('dir_foto/')) {
   while (
false !== ($file readdir($handle))) {
       if (
$file != "." && $file != "..") {
              list(
$largh$alt) = getimagesize($file);
           
$str.= 'La foto di nome '.$file.' è larga '.$largh.' e alta '.$alt.'
'
;
       }
   }
   
closedir($handle);

echo 
$str