我已经构建了一个HTML表并在其中加载数据。我想要做的是,根据包含数据的表创建(或转换)它excel并将excel文件保存在项目目录中。
这是我的HTML表格
<table class='tblNemoList' border='1' cellpadding='3' cellspacing='0' width='100%' style='-fs-table-paginate: paginate;'>
$thChanges
$trChanges
$thMissing
$trMissing
$thNew
$trNew
</table>
";
$strFilename = "FIM_KnowMore_Report_$DT";
excel转换就在这里
header("Pragma: no-cache");
header("Expires: 0");
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=". $strFilename .".xls"); //gets set inside the report.rpt.php
file_put_contents($strFilename, $strBody);
我错过了将其保存在目录中的代码。你能帮忙吗?