In fact, like this kind of PHP to expand a lot, but the project is not how to use:
<?PHP$zip=Newziparchive ();$filename= "./test112.zip";//to open a compressed package in a pattern created without being presentif($zip->open ($filename, ziparchive::create)!==TRUE){ Exit("Cannot open$filename\ n ");}Else{ //echo "Can be turned on"; Add files like a zipped package and write something in passing $zip->addfromstring ("test.txt", ' File content goes here! '); Echo $zip-Numfiles; Echo $zip-status; //Add the contents of the test.php file to te.php and add the te.php to the ZIP package $zip->addfile ("./test.php", "te.php"); $zip->setpassword ("111"); $zip-close ();}//Unzip//$zip = new Ziparchive (),//if ($zip->open ("./test112.zip") = = = TRUE) {//$zip->extractto ("./my/"); Unzip to my directory//$zip->close (); echo "OK";//}
Simple zip compression and decompression