public static function getStringBetween($str, $start, $end)
    {
        $str = ' ' . $str;
        $ini = strpos($str, $start);

        if ($ini == 0) {
            return '';
        }

        $ini += strlen($start);
        $len = strpos($str, $end, $ini) - $ini;
        return substr($str, $ini, $len);
    }
public static function getStringBetween($str, $start, $end)
    {
        $str = ' ' . $str;
        $ini = strpos($str, $start);

        if ($ini == 0) {
            return '';
        }

        $ini += strlen($start);
        $len = strpos($str, $end, $ini) - $ini;
        return substr($str, $ini, $len);
    }
public static function getStringBetween ( $ str , $ start , $ end ) { $ str = ' ' . $ str ; $ ini = strpos ( $ str , $ start ) ; if ( $ ini == 0 ) { return '' ; } $ ini += strlen ( $ start ) ; $ len = strpos ( $ str , $ end , $ ini ) - $ ini ; return substr ( $ str , $ ini , $ len ) ; }
Extracts a substring between 2 marks

@param string  $str      The target string
@param string  $start    The initial mark
@param string  $end      The end mark

@return string A substring or an empty string if is not able to find the marks
or if there is no string between the marks
Extracts a substring between 2 marks