Php implements zip file decompression ,. Php implements zip file decompression. PHP decompress the zip file function. the Source Code is short. you need to use the ZZIPliblibrary extension. make sure the extension is enabled before use. * ********************* @ Php to decompress the zip file,
PHP decompress the zip file function. the Source Code is short. you need to use the ZZIPlib library extension. make sure that the extension is enabled before use.
<? /********************** @ File-path to zip file the path of the file to be decompressed * @ destination -destination directory for unzipped files, make sure that this extension has enabled */function unzip_file ($ file, $ destination) {// instantiate object $ zip = new ZipArchive (); // open the zip file, if it fails to be opened, a prompt message is returned. if ($ zip-> open ($ file )! = TRUE) {die ("cocould not open archive");} // decompress the compressed file to the specified directory $ zip-> extracation ($ destination ); // close the zip file $ zip-> close (); echo 'archiveextracted to directory';} // test execution // unzip_file ("func.zip ", "jieya");?>
This is the function code for php to decompress the zip file. I hope it will be helpful for your learning.
Unzip, PHP decompress the zip file function, the source code is short, you need to use the ZZIPlib library extension, please confirm that the extension has been enabled before use. /***********************@...