php if statement when string has words code example Example: php find if string contains if (strpos($string, 'substring') !== false) { // do stuff }