public function isArrayOfWordsInString(array $wordArray, $content, $checkAll = false)
    {
        $found = false;
        foreach ($wordArray as $word) {
            if (mb_stripos($content, $word) === false) {
                $found = false;
                if ($checkAll === true) {
                    return false;
                }
            } else {
                $found = true;
                if ($checkAll === false) {
                    return true;
                }
            }
        }
        return $found;
    }
public function isArrayOfWordsInString(array $wordArray, $content, $checkAll = false)
    {
        $found = false;
        foreach ($wordArray as $word) {
            if (mb_stripos($content, $word) === false) {
                $found = false;
                if ($checkAll === true) {
                    return false;
                }
            } else {
                $found = true;
                if ($checkAll === false) {
                    return true;
                }
            }
        }
        return $found;
    }
public function isArrayOfWordsInString ( array $ wordArray , $ content , $ checkAll = false ) { $ found = false ; foreach ( $ wordArray as $ word ) { if ( mb_stripos ( $ content , $ word ) === false ) { $ found = false ; if ( $ checkAll === true ) { return false ; } } else { $ found = true ; if ( $ checkAll === false ) { return true ; } } } return $ found ; }
check if an array with words was found in given content
@param array $wordArray A single dimmed Array containing words
to search for. F.E. array('hello', 'georg', 'company')
@param string $content The string to search in
@param boolean $checkAll If this is checked, then all words have to be found in string.
If false: The method returns true directly, if one of the words was found
@return boolean Returns true if the word(s) are found
check if an array with words was found in given content