php导出excel

 1 <?php
 2     header("Content-Type: application/vnd.ms-execl");   
 3     header("Content-Disposition: attachment; filename=myExcel.xls");   
 4     header("Pragma: no-cache");   
 5     header("Expires: 0");   
 6     /*first line*/   
 7     echo "hello"."\t";   
 8     echo "world"."\t";   
 9     echo "\t\n";   
10        
11     /*start of second line*/   
12     echo "this is second line"."\t";   
13     echo "Hi,pretty girl"."\t";   
14     echo "\t\n";
15 ?>

 

posted @ 2013-07-29 10:18  烧饼程序猿  阅读(213)  评论(0)    收藏  举报