getting boolean value if a string exist in another string

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
itziktdk
Forum Newbie
Posts: 3
Joined: Wed Mar 24, 2010 4:28 am

getting boolean value if a string exist in another string

Post 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
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

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

Post by Weirdan »

Code: Select all

strpos($haystack, $needle) !== false
itziktdk
Forum Newbie
Posts: 3
Joined: Wed Mar 24, 2010 4:28 am

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

Post by itziktdk »

i'm sorry but i dont see anything
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

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

Post by Weirdan »

I've updated the code.
Post Reply