protected function getContentRange($header)
    {
        if (preg_match('/(?P<unit>[\w]+)\s+(?P<first>\d+)-(?P<last>\d+)\/(?P<length>\d+|\*)/', $header, $matches)) {
            $return = [];

            $return['unit'] = $matches['unit'];
            $return['first'] = (int) $matches['first'];
            $return['last'] = (int) $matches['last'];
            $return['length'] = is_numeric($matches['length']) ? (int) $matches['length'] : '*';

            return $return;
        }

        return false;
    }
protected function getContentRange($header)
    {
        if (preg_match('/(?P<unit>[\w]+)\s+(?P<first>\d+)-(?P<last>\d+)\/(?P<length>\d+|\*)/', $header, $matches)) {
            $return = [];

            $return['unit'] = $matches['unit'];
            $return['first'] = (int) $matches['first'];
            $return['last'] = (int) $matches['last'];
            $return['length'] = is_numeric($matches['length']) ? (int) $matches['length'] : '*';

            return $return;
        }

        return false;
    }
protected function getContentRange ( $ header ) { if ( preg_match ( '/(?P<unit>[\w]+)\s+(?P<first>\d+)-(?P<last>\d+)\/(?P<length>\d+|\*)/' , $ header , $ matches ) ) { $ return = [ ] ; $ return [ 'unit' ] = $ matches [ 'unit' ] ; $ return [ 'first' ] = ( int ) $ matches [ 'first' ] ; $ return [ 'last' ] = ( int ) $ matches [ 'last' ] ; $ return [ 'length' ] = is_numeric ( $ matches [ 'length' ] ) ? ( int ) $ matches [ 'length' ] : '*' ; return $ return ; } return false ; }
Parse content-range header to an array.

@see  http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16

@param   string $header

@return  false|array  An array with [unit, first, last, length] elements;
Parse content - range header to an array .