Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#1420·PHPExcel

Can't export any excel

Author: debin-geCreated Oct 19, 2018Updated Oct 19, 2018

I can't export any excel files, but it returns me a bunch of garbled.I just export an empty excel file.

$PHPExcel = new \PHPExcel(); $fileName='test'; $PHPWriter = \PHPExcel_IOFactory::createWriter($PHPExcel,'Excel2007'); header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Type: application/cha'); header("Content-Disposition: attachment;filename=$fileName".".xlsx"); header('Cache-Control: max-age=0'); $PHPWriter->save("php://output");

Source: PHPOffice/PHPExcel

View original on GitHubView discussion on GitHub