You could do this with less loops using a regular expression, e.g.:
$files = glob("*.*");
$exclude = array('thumb','other','ignore','.php');
$regexp = implode('|', array_map('preg_quote', $exclude));
foreach($files as $file)
{
if(preg_match("/$regexp/i", $file))
continue;
// handle $file here
echo "found file: $file\n";
}