Pclzip is a very powerful compression and decompression zip file PHP class, this article mainly introduces the use of Pclzip
Pclzip Introduction Pclzip is a powerful compression and decompression zip file of the PHP class, Pclzip Library can compress and extract compressed zip format (WinZip, PKZIP), and can handle such files, including the production of compressed files, List the contents of the compressed file and unzip the file, and so on. Simple, easy to use, powerful 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, had to recommend. Another reason for the recommendation is that in its source code I found a lewd use of PHP function parameters. Examples are shown below. To generate a zip file usage One: The code is 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: The code is 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)); >