win 开启php.ini中 extension=php_zip.dll
linux 编译的时候 增加 --enable-zip
在后在phpinfo()中有zip模块
$filepath='a.zip';
/* 创建ZipArchive对象 */
$zip = new ZipArchive();
/* 打开zip文件 */
$rs = $zip->open($filepath);
if($rs){
/* 解压缩到当前aa目录,这里是自动创建 */
$zip->extractTo('aa');
$zip->close();
}
文章末尾固定信息
我的微信
微信扫一扫
评论