简体   繁体   中英

How to read a xls file using zend framework?

How to read a xls file using zend framework?

Is it possible to read a xls file(Excel) named common.xls using Zend Spreadsheets .

Like mentioned in the comments you could use [PHPExcel][1]

//-----Create a reader, set some parameters and read in the file-----
$objReader = PHPExcel_IOFactory::createReader('CSV');
$objReader->setDelimiter(’,’);
$objReader->setEnclosure('');
$objReader->setLineEnding("\r\n");
$objReader->setSheetIndex(0);
$objPHPExcel = $objReader->load('path/to/commons.xls’);

Full tutorial http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2009/05/07/4606.aspx

Stackoverflow Qs that may help you -

PHPExcel reader -- help required


Or Have a look at PHP Excel Reader

Example

$data = new Spreadsheet_Excel_Reader("common.xls",false);

The simplest way to interact with an XLS file is to just dump it to HTML for display in a browser. This method will generate a table with inline CSS and all available formatting.

$data->dump($row_numbers=false,$col_letters=false,$sheet=0,$table_class='excel') 

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM