当前位置:首页 > PHP教程 > PHP高级教程

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

复制代码 代码如下:

/**********************
*@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压缩 在线对文件进行压缩的函数
【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!