Blogger Information
Blog 9
fans 0
comment 0
visits 14541
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php生成excel文件
小张的博客
Original
771 people have browsed it

实例

 if($type == 'excel2003')
{  
 header('Content-Type: application/vnd.ms-excel');  
 header("Content-Disposition: attachment;filename='{$fileName}'");  
 header('Cache-Control: max-age=0');  
 $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');  
 $objWriter->save('php://output');  
}
else{  
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');    
header("Content-Disposition: attachment;filename='{$fileName}'");    
header('Cache-Control: max-age=0');    
$objWriter = \PHPExcel_IOFactory:: createWriter($objPHPExcel, 'Excel2007');    
$objWriter->save( 'php://output');    
  
  }

运行实例 »

点击 "运行实例" 按钮查看在线实例


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post