On Wed, 27 Nov 2002 [EMAIL PROTECTED] wrote:

|You could try any number of PHP functions, but the best ones would be
|strchr/strstr/stristr (for locating the first occurrence of the string),
|strpos (find the position of the first occurrence), or strrchr (to find the

I was just using something like below. Seems to work to find the string
anywhere in the name. Am I missing something or is it really that simple?



$name = "John Smith";
$search = "smi";

if (eregi("$search", $name)) {
        echo "$search is in $name\n";
} else {
        echo "$search is NOT in $name\n";


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to