直接上代码,留作下次参考
function excelOut($num,$head, $data, $fileName) {
require './addons/library/PHPExcel/PHPExcel.php';
// TODO 查询记录
$cols = count($head);
if($num != 0){
$filePath = './data/uploads/'.$fileName;
$objPHPExcel = PHPExcel_IOFactory::load($filePath);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
for($i = 0; $i < 50; $i++) {
//导出数据为excel的最大值时
if($num == 1310 && $i