I am trying to get the contents from a gzipped file that is returned to me after using Mailchimp API doing a batch operation request. I expect to get only a JSON string as response, but also receive a bunch of numbers and random (?) strings.
This is what I do.
$gz = gzopen($response->response_body_url, "r");
$contents = trim(gzread($gz, 10000));
print_r($contents); //see output below
gzclose($gz);
This is what is returned to me.
0000777000000000000000000000000012705141572007721 5ustar rootroot./05fa27ceab.json0000666000000000000000000000121212705141572012327 0ustar rootroot[{"status_code":400,"operation_id":null,"response":"{\"type\":\"http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/\",\"title\":\"Member Exists\",\"status\":400,\"detail\":\"xxxx.xxxx@xxxx.xx is already a list member. Use PUT to insert or update list members.\",\"instance\":\"\"}"},{"status_code":400,"operation_id":null,"response":"{\"type\":\"http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/\",\"title\":\"Member Exists\",\"status\":400,\"detail\":\"xxxx2.xxxx2@xxxx2.xx is already a list member. Use PUT to insert or update list members.\",\"instance\":\"\"}"}]
What am I missing here? Why won't it work?