直接在网页里输出为excel和导出excel到本地两种格式.
直接用excel打开
<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
?>
<table width="300" border="0">
<tr>
<td colspan="3">这是测试内容请测试</td>
</tr>
<tr>
<td>sdcs</td>
<td>dcs</td>
<td>cscsc</td>
</tr>
<tr>
<td>cdscdc</td>
<td>scdsdc</td>
<td>scd</td>
</tr>
</table>