请帮忙解决,百度很久,找出解决方法//error_reporting(E_ALL);date_default_timezone_set('Europe/London');/** PHPExcel */
require_once 'PHPExcel.php';
// Create new PHPExcel object
$objPHPExcel = new PHPExcel();// Set properties
$objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
 ->setLastModifiedBy("Maarten Balliauw")
 ->setTitle("Office 2007 XLSX Test Document")
 ->setSubject("Office 2007 XLSX Test Document")
 ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
 ->setKeywords("office 2007 openxml php")
 ->setCategory("Test result file");
$objPHPExcel->setActiveSheetIndex(0);$str = iconv('UTF-8', 'GB2312','编号');
$objPHPExcel->getActiveSheet()->setCellValue('A1', $str);
$objPHPExcel->getActiveSheet()->setCellValue('B1', '名称');
// Miscellaneous glyphs, UTF-8
// Rename sheet
$table="cp";
$objPHPExcel->getActiveSheet()->setTitle($table);
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
$objPHPExcel->setActiveSheetIndex(0);
$excelName = $table."_".date("Ymd").'.xls';header('Content-Type: application/vnd.ms-excel');
header("Content-Disposition: attachment; filename=".urlencode($excelName));
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
exit;