------------------------------------------------ excel_export.php ----
<?php
header('Cache-Control: no-cache, must-revalidate');
header('Content-type: application/vnd.ms-excel');
header('Content-Disposition: filename=test.xls');
?>
<html>
<style>
TD{
font-size: 12px;
vertical-align: middle;
}
strong{
font-size: 14px;
}
</style>
<!--HTML中td元素的nowrap屬性工作表示禁止儲存格中的文字自動換行-->
<body>
<div><b>統考報名督促</b></div>
<table width="100%" border="1" align="center" cellspacing="1" cellpadding="1">
<tr align="center">
<td nowrap><b>序號</b></td>
<td nowrap><b>學生姓名</b></td>
<td nowrap><b>服務站</b></td>
<td nowrap><b>學籍批次</b></td>
<td nowrap><b>層次</b></td>
<td nowrap><b>專業</b></td>
<td nowrap><b>聯絡電話</b></td>
<td nowrap><b>手機</b></td>
<td nowrap><b>大學英語(B)</b></td>
<td nowrap><b>電腦應用基礎</b></td>
<td nowrap><b>大學語文(A)</b></td>
<td nowrap><b>大學語文(B)</b></td>
<td nowrap><b>高等數學(B)</b></td>
</tr>
<tr align="center">
<td nowrap>1</td>
<td nowrap>qifei</td>
<td nowrap>山東教學服務中心</td>
<td nowrap>200509</td>
<td nowrap>高起本</td>
<td nowrap>電腦科技</td>
<td nowrap>010-10101010</td>
<td nowrap>13233333333</td>
<td nowrap>通過</td>
<td nowrap>未通過</td>
<td nowrap>通過</td>
<td nowrap>未通過</td>
<td nowrap>免考</td>
</tr>
<tr align="center">
<td nowrap>2</td>
<td nowrap>qifei</td>
<td nowrap>山東教學服務中心</td>
<td nowrap>200509</td>
<td nowrap>高起本</td>
<td nowrap>電腦科技</td>
<td nowrap>010-10101010</td>
<td nowrap>13233333333</td>
<td nowrap>通過</td>
<td nowrap>未通過</td>
<td nowrap>通過</td>
<td nowrap>未通過</td>
<td nowrap>免考</td>
</tr>
</table>
<br>
<b>說明:</b><br>
1、china qifei<br>
2、Tianjin University<br>
</body>
</html>
------------------------------------------------ excel_export.php ----
其他格式檔案:
header("Content-type:application/vnd.ms-word");
header("Content-Disposition:filename=test.doc");
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
header("Content-type:application/vnd.ms-PowerPoint");
header("Content-Disposition:filename=test.ppt");