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>

?>

你可能感兴趣的:(Excel)