I’m trying to use strpos to search for some key words in a string using PHP. My question is how would I go about adding a array so I search for “keyword1” and “keyword2” to the code below.
if (strpos($string,'keyword1') !== false) {
$hasstring = "yes";
}
Thanks
If i understand your question correctly, an array is not needed. You can simply use strpos twice with an or (in php, ||) operator