php生成excle

方法一:

新建index.php,代码如下

<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=3333.xls");

echo "A1	 B1	 C1
";
echo "A2	 B2	 C2
";
echo "A3	 B3	 C3
";
?>

方法二:

新建index.php,代码如下

<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=3333.xls");

?>
<table width="100%%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>标题</td>
    <td>时间</td>
  </tr>
  <tr>
    <td>中韩渔船冲突再起</td>
    <td>2014-10-15</td>
  </tr>
</table>
原文地址:https://www.cnblogs.com/wesky/p/4029126.html