PHP : extract zip file

public static function extractFile($path, $destination){
$zip = new \ZipArchive;
if ($zip->open($path) === TRUE) {
$zip->extractTo($destination);
$zip->close();
return true;
} else {
return false;
}
}

Leave a comment