📅  最后修改于: 2022-03-11 14:57:15.550000             🧑  作者: Mango
$zipFile = "test.zip";
$fnNoExt = basename($zipFile, ".zip");
$date = new DateTime();
$now = $date->getTimestamp();
$destinationFolder = "/some/path/$fnNoExt-$now";
$zip = new ZipArchive;
if ($zip->open($zipFile, ZipArchive::CREATE) === TRUE) {
if(!is_dir($destinationFolder)){
mkdir($destinationFolder, 0777);
}
$zip->extractTo($destinationFolder);
$zip->close();
} else {
return FALSE;
}