1 header("Content-type: application/vnd.ms-excel"); 2 header("Content-disposition: attachment; filename=$EXPORT_TIME.xls"); 3 header("Cache-Control: no-cache, must-revalidate"); 4 header("Pragma: no-cache"); 5 6 <table> 7 <tr> 8 <td>1</td> 9 <td>2</td> 10 <td>3</td> 11 </tr> 12 </table>
这样运行页面就会导出一个XLS表格。