龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

PHP解压缩 Zip 文件

时间:2014-06-14 15:08来源:网络整理 作者:网络 点击:
分享到:
PHP解压缩 Zip 文件 [代码片段(18行)]
/**********************
 *@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';
 } 
精彩图集

赞助商链接