`str_replace('bytes=','',$_SERVER['HTTP_RANGE'])` ➫ `str_replace('bytes=', '', $_SERVER['HTTP_RANGE'])`.
Notice commas and spaces after them.