Skip to content

Instantly share code, notes, and snippets.

@wowo
Created November 23, 2010 21:45
Show Gist options
  • Save wowo/712600 to your computer and use it in GitHub Desktop.
Save wowo/712600 to your computer and use it in GitHub Desktop.
Decompresses gz archives on the fly while downloading from remote server
<?php
$path = "http://sznapka.pl/myarchive.gz";
$data = file_get_contents("compress.zlib://" . $path);
printf("Got from %s archive such content:\n%s", $path, trim($data));
// prints:
// Got from http://sznapka.pl/myarchive.gz archive such content:
// Hi, I'm gz-ipped and you can ungzip me and download on the fly :-)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment