Extract Zip

Extract Zip


Posted in : PHP Posted on : January 24, 2011 at 6:53 PM Comments : [ 0 ]

This section contains the detail about Extracting Zip into a folder.

Extract Zip to a Folder

In this section, you will learn how to extract a zip's content to a folder. For this purpose, we are using extractTo() function.

Example

In this example, we are extracting AddFileToZip.zip to a folder named as  "extract". Given below the code and output :

<?php
$zip = new ZipArchive;
if ($zip->open("./AddFileToZip.zip") === TRUE) {
$zip->extractTo("./ZippedContent/extract/");
$zip->close();
echo 'Zip Extacted Successfully';
} else {
echo 'Failed to Extract';
}
?>

Output :

Download Source Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics