Jump to content

So simple even a child could do it


johnsmith153

Recommended Posts

I am not a child, but my question is simple:

 

How would I check if a certain value existed in a string?

 

ie. check if the letter "e" exists is the string "Hello"

 

I normally use:

$b="Hello";
$a=str_replace("e", "", $b);
if($a!=$b){echo "The letter DOES exist";}

But this is a silly method.

Link to comment
https://forums.phpfreaks.com/topic/139334-so-simple-even-a-child-could-do-it/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.