//By far the most accurate: VIA https://stackoverflow.com/a/25633879/7596555 function containsWord($str, $word) { return !!preg_match('#' . preg_quote($word, '#') . '#i', $str); }