Created
January 20, 2014 14:19
-
-
Save joseporiol/8520644 to your computer and use it in GitHub Desktop.
Unzip file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function unzip_file($file, $destination) { | |
// create object | |
$zip = new ZipArchive() ; | |
// open archive | |
if ($zip->open($file) !== TRUE) { | |
die ('Could not open archive'); | |
} | |
// extract contents to destination directory | |
$zip->extractTo($destination); | |
// close archive | |
$zip->close(); | |
echo 'Archive extracted to directory'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
goosh