PclZip::PclZip() :
Class creator #实例化类
PclZip::create() :
Create the PKZIP file and add files or folders #创建压缩文件
PclZip::listContent() :
List content of an archive #获取压缩文件内容列表
PclZip::extract() :
Extract all or part of the content of the archive #解压文件/部分文件
PclZip::properties() :
Get properties of the archive #获取压缩文件信息
PclZip::add() :
Get properties of the archive #向压缩文件内添加内容(官网写错了)
PclZip::delete() :
Delete files inside the archive #删除压缩文件内文件
PclZip::merge() :
Add one archive content in a second archive #合并压缩文件
PclZip::duplicate() :
Duplicate the archive #复制压缩文件
include_once(‘pclzip.lib.php‘);
$archive = new PclZip(‘archive.zip‘);
$v_list = $archive->create(‘file.txt,data/text.txt,folder‘);
if ($v_list == 0) {
die("Error : ".$archive->errorInfo(true));
}
require_once(‘pclzip.lib.php‘);
$archive = new PclZip(‘archive.zip‘);
if ($archive->extract() == 0) {
die("Error : ".$archive->errorInfo(true));
}
require_once(‘pclzip.lib.php‘);
$archive = new PclZip(‘archive.zip‘);
if ($archive->extract(PCLZIP_OPT_BY_NAME, $fiel_list) == 0) {
die("Error : ".$archive->errorInfo(true));
}
原文:http://blog.csdn.net/qlong_dd/article/details/44201545