header('Content-Type: application/xlsx');
// header('Content-Disposition: attachment; filename='.$expTitle.'.xlsx'); //下载保存文件
$output = fopen($fileName,'w') or die("Can't open php://output");
// $output = fopen('php://output','w') or die("Can't open php://output");
//UTF8 csv文件头前需添加BOM,不然会是乱码
fwrite($output, chr(0xEF).chr(0xBB).chr(0xBF));
// 输出标题行
fputcsv($output, $expCellName);
//数据内容
foreach($expTableData as $row) {
fputcsv($output, $row);
}
fclose($output) or die("Can't close php://output");