当前位置:编程学习 > 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压缩 在线对文件进行压缩的函数

上一个:php set_time_limit(0) 设置程序执行时间的函数
下一个:Joomla下利用configuration.php存储简单数据

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,