if (strpos($string, 'substring') !== false) { //substring found in string } else { //substring not found }