How to use PHP's ZIP compressed classes
This article mainly explains "how to use PHP's ZIP compression class". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use PHP's ZIP compression class".
Function: compress files into zip, or rar compression package. The suffix name can be customized.
How to use it: instantiate it first, and then pass parameters. Two parameters. The first Array about the address of your file. The second is the absolute address of the archive file you want to save.
Examples of use:
The copy code is as follows:
$zipfiles = array ("/ root/pooy/test1.txt", "/ root/pooy/test2.txt")
$z = new PHPZip ()
/ / $randomstr = random (8)
$zipfile = TEMP. "/ photocome_". $groupid. ".zip"
$z-> Zip ($zipfiles, $zipfile); / / add file list
The ZIP compression classes for PHP are as follows:
The copy code is as follows: