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?
rarevideoexchange [ Di, 20 März 2007 02:19 ] [ ID #1663198 ]

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
pangea33 [ Di, 20 März 2007 03:48 ] [ ID #1663199 ]
PHP » alt.php » Question, search string for specified text. Thank you

Vorheriges Thema: Passing Flash array to PHP
Nächstes Thema: WTD: Site Design and Built