After making a gzip deflate request in PHP, I receive the deflated string in offset chunks, which looks like the following
Example shortened greatly to show format:
00001B4E
¾”kŒj…Øæ’ìÑ«F1ìÊ`+ƒQì¹UÜjùJƒZ\µy¡ÓUžGr‡J&=KLËÙÍ~=ÍkR
0000102F
ñÞœÞôΑüo[¾”+’Ñ8#à»0±R-4VÕ’n›êˆÍ.MCŽ…ÏÖr¿3M—èßñ°r¡\+
00000000
I’m unable to inflate that presumably because of the chunked format. I can confirm the data is not corrupt after manually removing the offsets with a Hex editor and reading the gzip archive. I’m wondering if there’s a proper method to parse this chunked gzip deflated response into a readable string?
I might be able to split these offsets and join the data together in one string to call gzinflate, but it seems there must be an easier way.
The proper method to deflate a chunked response is roughly as follows:
Here’s a handy PHP function to do that for you (FIXED):