Question, search string for specified text. Thank you
Hi, I have $string = "LONG STRING OF STUFF....."
How do I run a search on the $string for something like "FOOD", and if
it exists, any case upper/lower, if FoOd exists in $string it results
a 1 or 0 if not. Can someone please help me with?
Re: Question, search string for specified text. Thank you
On Mar 19, 9:19 pm, rarevideoexcha... [at] gmail.com wrote:
> Hi, I have $string = "LONG STRING OF STUFF....."
>
> How do I run a search on the $string for something like "FOOD", and if
> it exists, any case upper/lower, if FoOd exists in $string it results
> a 1 or 0 if not. Can someone please help me with?
You need to use the stristr function which is a case-insensitive
version of strstr, and will allow you to find a needle in a haystack.
http://us3.php.net/stristr