PHP: how to open a zip code

Is there an easy way to open and create zip with PHP?

+4
source share
3 answers

Check out the PHP Zip library . Here are a few related guides:

+5
source

Something like a zip library?

+3
source

Take a look at the documentation for ZipArchive , specifically open .

You use it as follows:

 <?php $zip = new ZipArchive; if ($zip->open('test.zip') === TRUE) { $zip->addFile('/path/to/index.txt', 'newname.txt'); $zip->close(); echo 'ok'; } else { echo 'failed'; } ?> 
+3
source

All Articles