Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

check if a string contains a word

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

Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #string #word
ADD COMMENT
Topic
Name
5+8 =