En anden udgave
<?php
$images = "images/"; # placering af billeder
$cols   = 4; # Antal kolonner
if ($handle = opendir($images)) {
   while (false !== ($file = readdir($handle))) {
       if ($file != "." && $file != ".." && $file != "xxx" && $file != "xxx.swf") { // her udelukkes bestemte filtyper
           $files[] = $file;
       }
   }
   closedir($handle);
}
$colCtr = 0;
echo '<table width="100%" cellspacing="3"><tr>';
foreach($files as $file)
{
  if($colCtr %$cols == 0)
  echo '</tr><tr><td colspan="'.$cols.'"><hr /></td></tr><tr>';
  echo '<td align="center"><img src="' . $images . $file . '" border=3 WIDTH="100" HEIGHT="100" /></td>';
  $colCtr++;
}
echo '</table>' . "\r\n";
?>