Skip to content

Instantly share code, notes, and snippets.

@vrushank-snippets
Created March 23, 2012 10:36
Show Gist options
  • Save vrushank-snippets/2169442 to your computer and use it in GitHub Desktop.
Save vrushank-snippets/2169442 to your computer and use it in GitHub Desktop.
PHP : Unzip zip files
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';
}
@darkworks
Copy link

darkworks commented Oct 17, 2016

change line #6

die ('Could not open archive');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment