PHP操作excel
在php的开头用header(“Content-type:application/vnd.ms-excel”);表示输出的是excel文件,用 header(“Content-Disposition:filename=test.xls”);表示输出的文件名为text.xls。这样就ok 了。
<?php
header(“Content-type:application/vnd.ms-excel”);
header(“Content-Disposition:filename=test.xls”);
?>
<table border=”1″ x:publishsource=”Excel” cellpadding=0 cellspacing=0 >
<tr>
<td>Date</td>
<td>Username</td>
<td>Trade_sn</td>
<td>Payment_id</td>
<td>Money</td>
<td>Paytype</td>
<td>Pay_id</td>
<td>Payment</td>
<td>Status</td></tr>
<?php
echo “<tr>”;
echo “<td width=’100%’>”.’1′.”</td>”;
echo “<td x:str width=’100%’>”.’2′.”</td>”;
echo “<td x:str width=’100%’>”.’3′.”</td>”;
echo “<td x:str>”.’4′.”</td>”;
echo “<td x:int>”.’5′.”</td>”;
echo “<td>”.’6′.”</td>”;
echo “<td>”.’7′.”</td>”;
echo “<td>”.’8′.”</td>”;
echo “<td>”.’9′.”</td>”;
echo “</tr>”;
?>
</table>
百度网盘:http://pan.baidu.com/s/1kTFn9sz
- WordPress伪静态规则(IIS/Apache/Nginx各版本)与404页面
- WordPress访问速度很慢解决方案