php的zip扩展应用例子

$zip = new ZipArchive;
$res = $zip->open(UPLOAD_DIR.'/attach.zip', ZIPARCHIVE::CREATE);
if ($res === true) {
       foreach ($fileinfo as $value) {
             $zip->addFile(UPLOAD_DIR.'/'.$value['SAVE_NAME'], $value['REAL_NAME']);
      }
      $zip->close();
}

你可能感兴趣的:(php的zip扩展应用例子)