Baptiste Arnaud Baptiste Arnaud - 1 year ago 59
PHP Question

how to verify that a string contains a caracter

$string = "#hello";

I'm trying to have
without the
. I also want a function to verify if the string contains the

str_replace("#", " ", $string);

and neither does


Any ideas ?

Answer Source

Compare the return value to the original.

if ($string != str_replace("#", " ", $string)


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download