1. 程式人生 > >phpexcel中文手冊

phpexcel中文手冊

$objPHPExcel = pc_base::load_app_class('PHPExcel'); //載入並輸出
$objReader = PHPExcel_IOFactory::createReaderForFile(PHPCMS_PATH.'phpcms/modules/excel_go/classes/myexchel.xlsx');$objPHPExcel = $objReader->load(PHPCMS_PATH.'phpcms/modules/excel_go/classes/myexchel.xlsx');$objPHPExcel->setActiveSheetIndex(0);header
('Content-Type:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');header('Content-Disposition:attachment;filename="01simple.xlsx"');header('Cache-Control:max-age=0');$objWriter =PHPExcel_IOFactory:: createWriter($objPHPExcel, 'Excel2007');$objWriter->save( 'php://output');