Faster word search?
Posted: Tue Jan 20, 2004 9:52 am
I'm doing a word search of a very large text file. Currently, I am using the following code to do the searching:
Is there a faster way to search for a word other than using a regexp? I only want to find whole words.
Code: Select all
$pattern = '/\b' . $term . '\b/i';
$found = preg_match($pattern, $msg);