Possible Duplicate:
Alternative for PHP_excel
I've found a number of PHP libraries for reading and parsing Excel files, such as PHPExcel and PHP-Excel-Reader. Are there any other ones, and which is the best (i.e. the most robust, most update-to-date, etc.)?
Loading a Spreadsheet File$inputFileName = './sampleData/example1. xls'; /** Load $inputFileName to a Spreadsheet Object **/ $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName); See samples/Reader/01_Simple_file_reader_using_IOFactory. php for a working example of this code.
Read an Excel File (XLSX)Browse each Sheet of the spreadsheet with $reader->getSheetIterator() Browse each Row of the Sheet with $sheet->getRowIterator() Browse each Cell of the Row with $row->getCells() Access each Value of the Cell with $cell->getValue()
You may use the following code: header('Content-Type: application/vnd. ms-excel'); header('Content-Disposition: attachment;filename="file. xlsx"'); header('Cache-Control: max-age=0'); $writer->save('php://output');
Definition of which is the best is very subjective... I have a vested interest when I say that PHPExcel is the best, because I'm the main developer. However:
Best is a very subjective term, and it really depends on your exact requirements including
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With