Verificar se string começa ou termina com determinado texto

Começa com:

 
function comecaCom($string, $search_string) {
	// search backwards starting from string length characters from the end
	return $search_string === "" || strrpos($string, $search_string, -strlen($string)) !== false; 
} 

Termina com:

 
function terminaCom($string, $search_string) {
	// search forward starting from end minus search_string length characters
	return $search_string === "" || (($temp = strlen($string) - strlen($search_string)) >= 0 && strpos($string, $search_string, $temp) !== false);
}