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