Home  >  Article  >  Backend Development  >  PHP zip decompression class pclzip usage example_PHP tutorial

PHP zip decompression class pclzip usage example_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:36:01906browse

PclZip is a very powerful PHP class for compressing and decompressing zip files. This article mainly introduces how to use PclZip

Introduction to PclZip PclZip is a very powerful PHP class for compressing and decompressing zip files. The PclZip library can compress and decompress Zip format compressed files (WinZip, PKZIP); and can process such files, including generating compressed files and columns. Extract the contents of compressed files and decompress files, etc. ​ Simple, easy to use, and powerful are my evaluations of it. ​ Recently, I was developing my WordPress plug-in ShareLink. In the process, I discovered PclZip, a PHP class for operating zip files, and I have to recommend it. ​ Another reason for recommendation is that I discovered a lewd usage of PHP function parameters in its source code. An example will be given below. ​ Generate 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)); } ?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/741814.htmlTechArticlePclZip is a very powerful PHP class for compressing and decompressing zip files. This article mainly introduces PclZip How to use PclZip Introduction PclZip is a very powerful tool for compressing and decompressing zip files...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn