我正在使用phpexcel以excel格式导出数据,一切正常。但是,当我打开下载的文件时,我看到它将(
和)
编码为(
和)
,我希望它是()
。我搜索了这个,但我不知道该怎么做。
以下是我的代码:
// Rename sheet
$objPHPExcel->getActiveSheet()->setTitle('Leads');
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
$objPHPExcel->setActiveSheetIndex(0);
// Redirect output to a client’s web browser (Excel5)
//header('Content-Encoding: UTF-8');
header('Content-Type: application/vnd.ms-excel; charset=utf-8');
if ($this->input->post('project_name') == 'all')
header('Content-Disposition: attachment;filename="Leads-'.date('d-m-Y H:i:s').'.xls"');
else
header('Content-Disposition: attachment;filename="'.$project_name.'.xls"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');