Pclzip Introduction
Pclzip is a very powerful PHP class for compressing and extracting zip files, and the Pclzip library is capable of compressing and decompressing compressed archives (WINZIP, PKZIP) in zip format, and can process such files, including generating compressed file, List the contents of the archive, unzip the file, and so on.
Simple, easy to use, strong is my evaluation of it.
Recently in the development of my WordPress plugin Sharelink, in this process, found Pclzip This operation zip file PHP class, have to recommend the next.
Another recommended reason is that in its source code I found a php function parameters of the lewd usage. An example is shown below.
Generate ZIP file
Usage One:
Copy the Code code as follows:
< PHP
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));
}
?>
Usage Two:
Copy the Code code as follows:
< PHP
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));
}
?>