Is there an existing way to parse the HTTP_RANGE header correctly in PHP? Thought I\'d ask here before re-inventing the wheel.
HTTP_RANGE
I am currently using
Taken from the PEAR Package HTTP_Download:
function getRanges() { return preg_match('/^bytes=((\d*-\d*,? ?)+)$/', @$_SERVER['HTTP_RANGE'], $matches) ? $matches[1] : array(); }
It is also a good idea to use this packages for stuff like this!