have a form that passes a variable into the following file...
//$searchstr is the string to search for in the file names
$directory = dir('images/directory');
while ($file = $directory->read()) {
if (eregi($searchstr, $file)) {
//if the filename contains the search string, output the filename
echo $file;
}
}
closedir($imgs->handle);
this should work...