欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

PHP能不能把生成的文件打包??

程序员文章站 2022-04-09 23:36:50
...
请问PHP能不能把生成的文件打包(压缩成一个压缩包)??如果可以,怎么实现

回复讨论(解决方案)

可以的 可以看看PHP的扩展 zip

ZipArchive

提供的方法
[0] => open
[1] => close
[2] => getStatusString
[3] => addEmptyDir
[4] => addFromString
[5] => addFile
[6] => addGlob
[7] => addPattern
[8] => renameIndex
[9] => renameName
[10] => setArchiveComment
[11] => getArchiveComment
[12] => setCommentIndex
[13] => setCommentName
[14] => getCommentIndex
[15] => getCommentName
[16] => deleteIndex
[17] => deleteName
[18] => statName
[19] => statIndex
[20] => locateName
[21] => getNameIndex
[22] => unchangeArchive
[23] => unchangeAll
[24] => unchangeIndex
[25] => unchangeName
[26] => extractTo
[27] => getFromName
[28] => getFromIndex
[29] => getStream