PHP Zip decompression class Pclzip Using the example _php instance

Source: Internet
Author: User
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));
}
?>

  • 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.