我有这样的zip文件
my.zip
hello.json
map
test.png
b.obj
使用以下代码提取
$zip = new ZipArchive;
$res = $zip->open('my.zip');
if ($res === TRUE) {
$zip->extractTo('/my/destination/dir/');
$zip->close();
echo 'ok';
} else {
echo 'failed';
}
它将创建这样的目录
/my/destination/dir/
my
hello.json
map
test.png
b.obj
我想得到这个结果
/my/destination/dir/
hello.json
map
test.png
b.obj
如何在php中执行此操作?
答案 0 :(得分:0)
现在我使用[unzip](https://gist.github.com/videni/d0b7690c67f63b66ffe37977e5967e9a)代码
解决了这个问题