php if string contians code example Example: php chech if string contains $a = 'How are you?'; if (strpos($a, 'are') !== false) { echo 'true'; }