"; // repeat for as long as there are files in the directory to be read while($fileName=$dir->read()) { // ignore the . and .. that are read as files if($fileName == "." || $fileName == "..") { continue; } // open the file, suppressing errors0 $filePicture = @fopen("$imagesDir/$fileName","r"); // if it's the 1st image, start the first row if ($imgCount == '0') {print "";} /* if the max number of images per row has been reached close that row and start a new one */ if ($imgCount%$imgPerRow == 0) { print ""; } ?> " height=""> " rel="imagepopup" title=""> " alt="" border=0 >