PHP Zip Decompression class Pclzip use example

Source: Internet
Author: User
Tags php class zip

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)); >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.