将多个文件打包成zip并下载
命令行下, 执行 composer 命令安装:
composer require hufang/neozip
use hufang\NeoZip\NeoZip;
$file_arr = [
0=>'file1_path', //值为文件路径 默认是public下的文件
1=>'file2_path',
2=>'/uploads/c5a.png',
];
// 下载download
NeoZip::zipAndDownload($file_arr);
可以自行修改 src/ 下 NeoZip.php 中的文件名