PclZip是一个很强大的压缩与解压缩zip文件的PHP类,这篇文章主要介绍了PclZip的使用方法
PclZip简介
PclZip是一个很强大的压缩与解压缩zip文件的PHP类,PclZip library能够压缩与解压缩Zip格式的压缩档(WinZip、PKZIP);且能对此类类档案进行处理,包括产生压缩档、列出压缩档的内容以及解压缩档案等等。
简单、易用、强大是我对它的评价。
最近在开发我的Wordpress插件ShareLink,,在这过程中,发现了PclZip这个操作zip文件的PHP类,不得不推荐下。
还有另外一个推荐的原因就是在它的源码里面让我发现了一个PHP函数参数的淫荡用法。下面将举例说明。
生成zip文件
用法一:
复制代码 代码如下:
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));
}
?>
用法二:
复制代码 代码如下:
include_once('pclzip.lib.php');
$archive = new PclZip('archive.zip');
$v_list = $archive->create('data/file.txt,data/text.txt',
PCLZIP_OPT_REMOVE_PATH,'data',
PCLZIP_OPT_ADD_PATH,'install');
if($v_list==0){
die("Error:".$archive->errorInfo(true));
}
?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version
SublimeText3 Linux latest version

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Atom editor mac version download
The most popular open source editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)
