title: Uncompress gzip compressed http response
body: <p>I'm using php's <code>file_get_contents()</code> function to do a HTTP request. To save bandwidth I decided to add the <code>"Accept-Encoding: gzip"</code> header using <code>stream_context_create()</code>.</p>
  
  <p>Obviously, <code>file_get_contents()</code> outputs a gzip encoded string so I'm using <code>gzuncompress()</code> to decode the encoded string but I get an error with data passed as argument.</p>
  
  <pre><code>[...] PHP Warning: gzuncompress(): data error in /path/to/phpscript.php on line 26
  </code></pre>
  
  <p>I know there is another function able to decompress gzipped data <code>gzdecode()</code> but it isn't included in my PHP version (maybe it is only available on SVN).</p>
  
  <p>I know that cUrl decodes gzip stream on the fly (without any problem) but someone suggested me to use <code>file_get_contents()</code> instead of cUrl.</p>
  
  <p>Do you know any other way to decompress gzipped data in PHP or why <code>gzuncompress()</code> outputs a Warning? It is absurd that <code>gzuncompress()</code> doesn't work as expected.</p>
  
  <p>Notes:
  The problem is certainly about PHP: the HTTP request is made to Tumblr API that give a well-encoded response.</p>