Pclzip Introduction
the Pclzip library compresses and compresses zip files (WinZip, pkzip) and can process such files, including producing compressed files, listing the contents of compressed files, and decompressing files. Because of the ability to compress and decompress on the server side of the action, it is quite convenient to use.
Pclzip defines a Pclzip class whose class object can be treated as a zip file and as a method for processing.
Pclzip official Address: http://www.phpconcept.net/pclzip/index.php
Instance Code
<?php
Include_once (' pclzip.lib.php '); Load class file
$filename =time (). ' Bnxf.zip ';/compressed file name
$path = '. /.. /..'. $_get[' path '];//files that need to be compressed
$archive = new Pclzip ($filename);
$v _list = $archive->create ($path, Pclzip_opt_remove_all_path,pclzip_opt_add_path, ' bnxf '); Change the compressed file directory to BNXF
if ($v _list = = 0) {
Die ("Error:". $archive->errorinfo (true));
}else{
echo "compact Success";
}
?>