Hi.

I don't know why but I've had the darndest time trying to find an easy
equivalent of asp's InStr() function in PHP. I know there is
preg_match(), strpos(), and strstr(), but none of them work like I want
them to.

In fact, except for maybe preg_match(), I can't get any of them to work
right.

I want a function that will return true if the string is found, and
false if it is not found.

Like this:*

$needle = "&";
$haystack = "Belle & Sebastian";

if(FoundInString($needle, $haystack))
{
        echo "found!";
}
else
{
        echo "not found!";
}


Anyone have a function to share?


Thanks,
Chris.


* Anyone catch the Belle & Sebastian show at the Greek Theatre in LA
this past sunday?

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

Reply via email to