Unzip Zip file with PHP
Yesterday
I got a question from my friend, how unzip a word file that zipped using PHP. He wants extracting that file on server.Here
using php default ZipArchive class.
To start with we should have the following
minimum requirements
- PHP with ziparchive class
working
- Install this code and edit zipfile name with your file name, and place file with same folder.
- After execution there created a directory extracted and out put file will be there
Source code
03 | $res = $zip ->open( 'YourZipFile.zip' ); |
05 | $zip ->extractTo( 'extracted/' ); |
07 | echo 'Unzip was successful' ; |
09 | echo 'Unzip was not successful' ; |
0 comments:
Post a Comment