Php – Removing specific characters from a string in php

charphpstrpos

How can I check a string in php for specific characters such as '#' or '\'?

I don't really want to use replace, just return true or false.

Thanks

Best Solution

use the function strstr http://us2.php.net/manual/en/function.strstr.php Returns part of haystack string from the first occurrence of needle to the end of haystack

Note: If you only want to determine if a particular needle occurs within haystack , use the faster and less memory intensive function strpos() instead.