加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

PHP Zip解压 文件在线解压缩的函数代码

发布时间:2020-12-13 05:43:58 所属栏目:PHP教程 来源:网络整理
导读:div class="codetitle" a style="CURSOR: pointer" data="79088" class="copybut" id="copybut79088" onclick="doCopy('code79088')" 代码如下: div class="codebody" id="code79088" / ** @file - path to zip file @destination - destination directory f

<div class="codetitle"><a style="CURSOR: pointer" data="79088" class="copybut" id="copybut79088" onclick="doCopy('code79088')"> 代码如下:<div class="codebody" id="code79088">
/**
@file - path to zip file
@destination - destination directory for unzipped files
*/
function unzip_file($file,$destination){
// create object
$zip = new ZipArchive() ;
// open archive
if ($zip->open($file) !== TRUE) {
die ('Could not open archive');
}
// extract contents to destination directory
$zip->extractTo($destination);
// close archive
$zip->close();
echo 'Archive extracted to directory';
}

PHP Zip压缩 在线对文件进行压缩的函数

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读