mabye you could do something like this
$fp = fopen("fileextensions.dat","r");
$i = 0;
while(!feof($fp)) {
$array[$i] = fgets($fp,30);
$i++
}// end while
then after loading extensions from a file you could
$handle=opendir('.');
$k = 0;
while (false!==($open = readdir($handle))) {
$flag = false;
for($j = 0; $j < $i && !$flag; $j++) {
if (ereg($array[$j], $open)) {
$editable_files[$k] = $open;
$k++;
$flag = true;
} // end if
}// end for
}// end while
Although I havent tried that something like that might do nicely. Then again there could be an easier way to do this (since this would give you an O[n2] search).
Hope this helps.