PHP Excel export Spreadsheet_Excel_Writer

Source: Internet
Author: User
Tags php excel
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.