我想下载一个zip存档,并使用PHP将其解压缩到内存中.
这就是我今天所拥有的(而且对我来说文件处理太多:)):
// 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->open('./data/zip.kmz');
if ($res === TRUE) {
$zip->extractTo('./data');
$zip->close();
}
// use the unzipped files...
Run Code Online (Sandbox Code Playgroud)