Skip to content

Instantly share code, notes, and snippets.

@shmurakami
Created August 19, 2015 03:42
Show Gist options
  • Save shmurakami/0432be72eb31198f58d8 to your computer and use it in GitHub Desktop.
Save shmurakami/0432be72eb31198f58d8 to your computer and use it in GitHub Desktop.
Get Contents of remote gzip file with PHP
<?php
$context = stream_context_create([
'http' => ['header' => 'Accept-Encoding: gzip'],
]);
$fp = fopen($outputUrl, 'rb', false, $context);
$prediction = gzdecode(stream_get_contents($fp));
fclose($fp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment