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'; } ?>
[ 0 ] Comments