I often find myself doing quick checks like this:
if (!eregi(\'.php\', $fileName)) { $filename .= \'.php\'; }
But as eregi() was deprec
Perhaps you should consider refactoring your code to do this instead:
if (substr($fileName, -4, 4) !== '.php') $fileName .= '.php';
As stated in other answers to this question, eregi('.php') will search for anything followed by 'php' ANYWERE in the file (not just at the end).
eregi('.php')