php 中简单输出 csv和excel

<?php

 header("Content-type:application/vnd.ms-excel");
 header("Content-Dispotion:filename='test.xls' ");


 echo "a\t b\t c\n";
 echo "aa\t bb\t cc\n";
 echo "aaa\t bbb\t cccc\n";

<table width="500" border=1>
   <tr><td colspan=2>测试excel</td></tr> 
   <tr>
          <td>编号</td>
          <td>姓名</td>
   </tr> 
   <tr>
          <td>1</td>
          <td>one</td>
    </tr> 
   <tr>
          <td>2</td>
          <td>two</td>
    </tr> 
   <tr>
          <td>=A3+A4</td>
          <td>=SUM(B3:B4)</td>
    </tr> 
</table>
?>
posted @ 2012-11-11 18:46  转角遇到bug  阅读(437)  评论(0编辑  收藏  举报