Return to Snippet

Revision: 16876
at August 18, 2009 05:25 by level09


Initial Code
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';
}

Initial URL

                                

Initial Description

                                

Initial Title
Unzip zip files

Initial Tags

                                

Initial Language
PHP