php生成excle
方法一:
新建index.php,代码如下
<?php header("Content-type:application/vnd.ms-excel"); header("Content-Disposition:filename=3333.xls"); echo "A1\t B1\t C1\n"; echo "A2\t B2\t C2\n"; echo "A3\t B3\t C3\n"; ?>
方法二:
新建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>