创建时,只需将所需的目标路径传递给zip:
原文链接:https://www.f2er.com/php/137998.html$path = 'path/to/file.zip'; $zip = new ZipArchive(); $zip->open($path,ZipArchive::CREATE); // add contents... $zip->close();