【发布时间】:2011-11-15 13:24:10
【问题描述】:
我想下载一个 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...
【问题讨论】: