Spreadsheet_Excel_Writer of PHP Excel export has seen a lot of articles on PHP Excel export and has been implemented in many ways,
For example, echo a Table and modify the header to Excel.
In fact, among the many methods, it seems that Spreadsheet_Excel_Writer in Pear is very useful.
This article does not describe how to install Spreadsheet_Excel_Writer.
The answer :) can also refer to: http://pear.php.net/package/Spreadsheet_Excel_Writer/download
Send('test.xls '); // Create a Worksheet $ worksheet = & $ workbook-> addWorksheet ('my first worksheet '); // set the font Size $ format_column = & $ workbook-> addformat (array ('size' => 9, 'bold '=> 1 )); // write data // the header line (the first line) $ worksheet-> write (0, 0, 'name', $ format_column); $ worksheet-> write (0, 1, 'age', $ format_column); // The first person (row 2) $ worksheet-> write (1, 0, 'John Smith '); $ worksheet-> write (1, 1, 30); // second person (third row) $ worksheet-> write (2, 0, 'Johann Schm Idt '); $ worksheet-> write (2, 1, 31); // third person (row 4) $ worksheet-> write (3, 0, 'Juan Herrera '); $ worksheet-> write (3, 1, 32); // close Workbook $ workbook-> close ();?>
:
Of course, Spreadsheet_Excel_Writer has more than these settings. for details, see:
Http://pear.php.net/package/Spreadsheet_Excel_Writer/docs