Replaced deprecated eregi function with preg_match