title: In memory download and extract zip archive
body: <p>I would like to download a zip archive and unzip it in memory using PHP.</p>
  
  <p>This is what I have today (and it's just too much file-handling for me :) ):</p>
  
  <pre><code>// download the data file from the real page
  copy("http://www.curriculummagic.com/AdvancedBalloons.kmz", "./data/zip.kmz");
  
  // unzip it
  $zip = new ZipArchive;
  $res = $zip-&gt;open('./data/zip.kmz');
  if ($res === TRUE) {
      $zip-&gt;extractTo('./data');
      $zip-&gt;close();
  }
  
  // use the unzipped files...
  </code></pre>