Php implements zip file decompression. _ PHP Tutorial

Source: Internet
Author: User
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. /***********************@...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.