Home >Backend Development >PHP Tutorial >用PHP制作zip压缩程序_PHP

用PHP制作zip压缩程序_PHP

WBOY
WBOYOriginal
2016-06-01 12:33:03832browse

刚在网上找的一个类。点击下载类文件(zip压缩文件,2.25K)

$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