preg_match vs eregi
Posted: Tue May 21, 2002 3:20 am
I'm running a script that does a large number of eregis, eregi_replaces etc, and heard that preg_match and preg_replace as well as str_replace can all be faster. As the script is running quite slowly, I've played around with these a little and had a look at the manual, but am a little confused.
Should this not return true if $word has a hyphen in it? For some reason it's throwing up errors and I can't for the life of me figure out why....
Should this not return true if $word has a hyphen in it? For some reason it's throwing up errors and I can't for the life of me figure out why....
Code: Select all
if (preg_match("-",$word)) {