Home >Backend Development >PHP Tutorial >一个zip压缩的类,用起来很简单_PHP

一个zip压缩的类,用起来很简单_PHP

WBOY
WBOYOriginal
2016-06-01 12:27:09896browse

刚在网上找的
$z = new PHPZip(); //新建立一个zip的类

方法一:
$z -> Zip("", "out1.zip"); //添加当前目录和子目录下的所有档案


方法二:
$files=array('1.txt','gb.txt');
$files[]='5.txt';
$z -> Zip($files, "out2.zip"); //添加文件列表


方法三:
$z -> Zip("/usr/local/sext/", "out3.zip"); //添加指定目录

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn