在线解压zip
时间:2021-07-01 10:21:17
帮助过:618人阅读
在线解压zip
- $zipfile = 'test.zip';
- $zipdir = './test/';
- $zip = new ZipArchive();
- $rs = $zip->open($zipfile);
- if($rs !== TRUE)
- {
- die('Error :'. $rs);
- }
- $zip->extractTo($zipdir);
- $zip->close();
- //unlink($zipfile);
- $array = array();
- if ($handle = opendir($zipdir)) {
- while (false !== ($file = readdir($handle))) {
- if ($file != "." && $file != "..") {
- $array[] = $file;
- }
- }
- closedir($handle);
- }
- sort($array);
- var_dump($array);
|