我有三个问题要问您(使用PHP):
1.是否可以检索位于服务器端的MP3音频的时间?
2.是否可以仅在服务器端的一个中加入两个或多个MP3音频?
3.是否可以通过服务器端的文件夹创建一个zip文件并通过Web浏览器自动下载?
谢谢,
pasquy73
最佳答案
$ zipFile = tempnam('/ tmp /','zip');
$ zip = new ZipArchive();
$ zip-> open($ zipFile,ZipArchive::CREATE);
foreach(新的DirectoryIterator($ dir)为$ fi){
如果($ fi-> isFile()&& $ fi-> isReadable()){
$ zip-> addFile($ fi-> getPathname());
}; //如果
}; // foreach
$ zip-> close();
header('Content-type:application / zip');
回声file_get_contents($ zipFile);
unlinke($ zipFile);
关于php - PHP中的音频和Zip文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25929218/