PHPExcel is a phenomenal Excel generating library for PHP which I have mentioned on this site numerous times before, and which is currently my defacto way for quickly knocking out all those annoying Excel downloads that clients always seem to MUST have!
Now the recommended method for applying styles to cells or cell ranges is by making use of style arrays to set a number of styles all at once, mostly because setting styles one by one can turn out to be a little resource intensive.
So in keeping with this then, here is how you would make a cell’s contents bold:
$workbook = new PHPExcel;
$sheet = $workbook->getActiveSheet();
$sheet->setCellValue('A1', 'Hello World');
$styleArray = array(
'font' => array(
'bold' => true
$writer = new PHPExcel_Writer_Excel5($workbook);
And there you go, as simple as that!
Related Link: http://phpexcel.codeplex.com