PHP How to zip a folder

For ziping and unziping we can use PHP ZipArchive libraries

bellow code will zip a folder recursively

 

For unzip

Requirements :

http://php.net/manual/en/zip.requirements.php

Note : – php5.6 bellow version wi;; not support to create password protected zip,  php5.6 and above will support to create password protected archives. All you need is to add this code ZipArchive::setPassword($password).

ref:

http://php.net/manual/en/book.zip.php, http://php.net/manual/en/zip.examples.php, http://stackoverflow.com/questions/4914750/how-to-zip-a-whole-folder-using-php

  Like
Author: bm on May 12, 2016
Category: php

Your comment:

Your Name

Comment:




Last articles