我正在使用核心 PHP。我需要以粗体格式制作标题文本并保持正常文本格式。.xls 文件将从 PHP 导出。
我没有在我的项目中使用任何插件。我需要在不使用任何插件的情况下完成此操作。但我无法解决这个问题。
我的代码如下,
//header part cration
while($r=mysql_fetch_array($exe))
{
//need to set bold. But it is not working. it giving error
//$header .= "<b>".$r['question']."</b>"."\t ";
$header .=.$r['question']."\t ";
}
//body part cration
while($r=mysql_fetch_array($exe))
{
$data .= $r['answer']."\t ";
//code continuous...
}
和导出代码如下,
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=reports.xls");
header("Pragma: no-cache");
header("Expires: 0");
print "$header\n\n$data";
导出文件工作正常。但是我无法使标题变粗。
请非常感谢任何帮助。