0

我想用 PHPExce 导出几个文件,问题是代码运行良好但只导出一个文件。

这是我的 foreach 循环后的最终代码:

    header('Content-Type: application/vnd.ms-excel');
    $objWriter = IOFactory::createWriter($Xls, 'Excel5');
    header('Content-type: application/vnd.ms-excel');
    header('Content-Disposition: attachment; filename="test.xls"');
    header('Cache-Control: max-age=0');
    $objWriter->save('php://output');

谢谢

4

0 回答 0