Or faster (and, like the others, I'm assuming you want the containment to be case-sensitive):
if(strpos($text,$pattern)!==false) // 0==false but 0!==false
{ // $pattern is contained in $text
}
If you want case-insentive matching, I'd use preg_match
if(preg_match("/$pattern/i", $text))
{ // $pattern is contained in $text
}
And if you don't want e.g., CHM to be found in the string "batchmode":
if(preg_match("/\b$pattern\b/i", $text)) // matching word boundaries
{ // $pattern is contained in $text
}