How to check, if a string contain multiple specific words?
I can check single words using following code:
$data = "text text text text text text t
You can't do something like this:
if (strpos($data, 'bad || naughty') !== false) {
instead, you can use regex:
if(preg_match("/(bad|naughty|other)/i", $data)){ //one of these string found }