Page 1 of 1

getting boolean value if a string exist in another string

Posted: Wed Mar 24, 2010 4:37 am
by itziktdk
I but how can i get a boolean value, true of false, if the string is occur?

i wanna to use the switch condition and i have to use only the "==" oprator

Thanks in advance
Itzik

Re: getting boolean value if a string exist in another strin

Posted: Wed Mar 24, 2010 4:51 am
by Weirdan

Code: Select all

strpos($haystack, $needle) !== false

Re: getting boolean value if a string exist in another strin

Posted: Wed Mar 31, 2010 5:03 pm
by itziktdk
i'm sorry but i dont see anything

Re: getting boolean value if a string exist in another strin

Posted: Thu Apr 01, 2010 3:57 am
by Weirdan
I've updated the code.