發表文章

目前顯示的是有「export」標籤的文章

How to PHP export to Excel 2

How to use PHP to export excel file. export.php <? php // load library require 'php-excel.class.php' ; // create a simple 2-dimensional array $data = array (         1 => array ( 'Name' , 'Surname' ),         array ( 'Schwarz' , 'Oliver' ),         array ( 'Test' , 'Peter' )         ); // generate file (constructor parameters are optional) $xls = new Excel_XML ( 'UTF-8' , false , 'My Test Sheet' ); $xls -> addArray ( $data ); $xls -> generateXML ( 'my-test' ); ?> php-excel.class.php <? php /**  * Simple excel generating from PHP5  *  * @package Utilities  * @license http://www.opensource.org/licenses/mit-license.php  * @author Oliver Schwarz <oliver.schwarz@gmail.com>  * @version 1.0  */ /**  * Generating excel documents on-the-fly from PHP5  *  * Uses the excel XML-specification t...

How to PHP export to Excel

How to PHP export to Excel export.php <?php require 'php-excel.class.php'; $xls = new Excel('Sheet1'); $xls->worksheets['Sheet']->addRow(array("col1"," col2 "," col3 ")); $xls->addsheet(' Sheet2 '); $xls->worksheets[' Sheet2 ']->addRow(array(" col1a "," col2a "," col3a ")); $xls->generate('export'); ?> php-excel.class.php <?php class WorkSheet { private $lines = array(); public $sWorksheetTitle; public function __construct($sWorksheetTitle) { $this->setWorksheetTitle($sWorksheetTitle); } public function setWorksheetTitle ($title) { $title = preg_replace ("/[\\\¦:¦\/¦\?¦\*¦\[¦\]]/", "", $title); $title = substr ($title, 0, 31); $this->sWorksheetTitle = $title; } public function addRow ($array) { $cells = ""; foreach ...