$string1 = 'he said hello world'; $match1 = 'hello world'; echo substr($string1, strpos($string1, $match1), strlen($match1)); $string2 = 'hello molly he said'; $match2 = 'hello molly'; echo substr($string2, strpos($string2, $match2), strlen($match2));