I would like to download a zip archive and unzip it in memory using PHP.
This is what I have today (and it\'s just too much file-handling for me :) ):
You can get a stream to a file inside the zip and extract it into a variable:
$fp = $zip->getStream('test.txt'); if(!$fp) exit("failed\n"); while (!feof($fp)) { $contents .= fread($fp, 1024); } fclose($fp);