php导出Excel

                      
                            <

//设置输出头

header('Content-Type: application/vnd.ms-excel');

header('Content-Disposition: attachment;filename="产品统计'.date("Y-m-d-H:i:s").'.xls"');

header('Cache-Control: max-age=0');

//要输出的表格html代码

$table="";
//表格的样式
$style=""; 
 
//最后这么干,就可以导出表格数据到Excel了 

echo $style.$table;

exit; 


>