The below code is an if statement to check if a string/sentence contains a specific word.
<?php $a = 'this is a sentence'; if (strpos($a,'this') !== false) { echo 'true'; } ?>