Posted by Johannes Wienke on 04/01/06 01:05
Am 31.03.2006 17:05 schrieb Jesper:
> I'm going to use a lot of searches for occurences of words in a long text:
> $string = "a 500 character Text";
> if (eregi("text", $string)) { print "found";}
That's deprecated. preg_match is much better.
> Eregi should be very slow, so I'm looking for alternatives. Any suggestions?
> I guess I could use something like
> $string = strtolower($string);
> if ( strpos($string, "text") !== false ) { print "found";}
>
> Is that the best solution?
RTFM...
Navigation:
[Reply to this message]
|