I work mainly PHP. I need to make the header text in bold and keep the normal text format. The .xls file will be exported from PHP.
I do not use the plugin in my project. I need to accomplish this without using any plugin. But I canโt solve it.
My code is as follows:
//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... }
and Export code as follows:
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";
File export works fine. But I canโt make the headlines bold.
Please help with the rating.
source share