<?php
$dont_show = array(
'highlight',
'thumbs',
'.bak',
'.lock',
);
$path = "/home/jedmonds/www/gallery/albums/headshots/";
$dir_handle = @opendir($path) or die("Unable to open $path");
while (false !== ($file = readdir($dir_handle)))
{
if($file == "." || $file == ".." || $file == "index.php" ) continue;
foreach ($dont_show as $string) {
if (false !== strpos($file, $string)) continue;
}
if ($images == $file)
{
$selected = ' selected="selected"';
} else {
$selected = '';
}
echo "<option value=\"$file\"$selected>$file</option>";
}
closedir($dir_handle);
?>
you could also use regular expressions for this.