I have a string like this:
$str = "it is a test";
I want to check it for these words: it
, test
. I want to it returns true
if there is at least one of those words in the string.
Here is what I did: (though it does not work)
$keywords = array ('it', 'test');
if(strpos($str, $keywords) !== false){ echo 'true';}
else echo 'false';
How can I do that?