Cake\Http\ResponseEmitter::parseContentRange PHP Method

parseContentRange() protected method

Parse content-range header http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16
protected parseContentRange ( string $header ) : false | array
$header string The Content-Range header to parse.
return false | array [unit, first, last, length]; returns false if no content range or an invalid content range is provided
    protected function parseContentRange($header)
    {
        if (preg_match('/(?P<unit>[\\w]+)\\s+(?P<first>\\d+)-(?P<last>\\d+)\\/(?P<length>\\d+|\\*)/', $header, $matches)) {
            return [$matches['unit'], (int) $matches['first'], (int) $matches['last'], $matches['length'] === '*' ? '*' : (int) $matches['length']];
        }
        return false;
    }