That was obviously written by someone who doesn't know how to use [man]strpos[/man] to see if a substring exists (the code given risks bugs if for some wacky reason you want $start to start with a space).
You can replace the first three lines with
$ini = strpos($string, $start);
if($ini===false) return "";
But I was bored: I thought I'd find a different way to do it. Without strpos or substr.
function get_string_between($string, $start, $end){
$chunk = explode($start, $string, 2);
if(count($chunk)==1) return "";
$chunk = explode($end, $chunk[1], 2);
if(count($chunk)==1) return "";
return $chunk[0];
}