PHP - Check if a string contains any of the chars in another string
php, string
Solution
You can do it using
$a = "asd";
$b = "ds";
if (strpbrk($a, $b) !== FALSE)
echo 'Found it';
else
echo "nope!";
For more info check : http://php.net/manual/en/function.strpbrk.php
Second parameter is `case sensitive`.
Problem
How can I check if a string contains any of the chars in another string with PHP? ``` $a = "asd"; $b = "ds"; if (if_first_string_contains_any_of_the_chars_in_second_string($a, $b)) { echo "Yep!"; } ``` So in this case, it should echo, since ASD contains both a D and an S. I want to do this without regexes.