输入banner图图片脚本导航/分类

PHP解压缩zip文件

可解压缩zip文件。它有两个参数:压缩文件的路径、目标文件的路径。
  1. function unzip_file($file, $destination) {
  2. // create object
  3. $zip = new ZipArchive() ;
  4. // open archive
  5. if ($zip->open($file) !== TRUE) {
  6. die ('Could not open archive');
  7. }
  8. // extract contents to destination directory
  9. $zip->extractTo($destination);
  10. // close archive
  11. $zip->close();
  12. echo 'Archive extracted to directory';
  13. }

解压缩, PHP, zip