[TOC]PHPExcel导出数据 页面地址重定向问题(这里写自定义目录标题)
ini_set("max_execution_time", 0);
ob_end_clean();//清楚缓冲区 防止乱码
vendor("PHPExcel.Classes.PHPExcel");
vendor('PHPExcel.Classes.PHPExcel.IOFactory.PHPExcel_IOFactory');
vendor('PHPExcel.Classes.PHPExcel.Reader.Excel5');
此时可能随着PHP环境的升级导出数据可能报错哦
#很简单只改导出参数即可:
header('pragma:public');
header("Content-Disposition:attachment;filename=$fileName.xlsx");
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
#老代码
header('pragma:public');
header("Content-Disposition:attachment;filename=$fileName.xls");
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
问题即可解决!