我正在以表格格式创建报告.此报告显示在浏览器上.我想以excel格式链接提供下载报告,以便报告也可以在excel文件中使用.我怎样才能做到这一点
Vib*_* TV 13
<?php
$file="test.xls";
$test="<table border=1><tr><td>Cell 1</td><td>Cell 2</td></tr></table>";
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$file");
echo $test;
?>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
41904 次 |
| 最近记录: |