http://pastebin.com/dHbqjUNy
define('STR_BOM', "\xEF\xBB\xBF");
$file = null;
$directory = getcwd();
$rit = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::CHILD_FIRST);
try {
foreach ($rit as $file) {
if ($file->isFile()) {
$path_parts = pathinfo($file->getRealPath());
if ('php' == $path_parts['extension']) {
$object = new SplFileObject($file->getRealPath());
if (false !== strpos($object->getCurrentLine(), STR_BOM)) {
print $file->getRealPath()."\n";
}
}
}
}
} catch (Exception $e) {
die ('Exception caught: '. $e->getMessage());
}
remember to wrap it in php tags - they are being removed by blogger so i can't show them.