Category:Library -> Data Conversion
This library reads an Excel formatted spreadsheet document. Currently it only works with newer versions of Excel but will be made to work with older versions in time.
The library is made for CI 1.5 or newer and currently does not depend on any other CI libraries or helpers. Just place the library file in the libraries folder and load it as normal. Its usage is a bit limited right now, once the spreadsheet is read you can access each worksheet as a two-dimensional array. Currently this array is a jagged array, that is, it only reflects the cells from the worksheet that contain data, not the empty ones. I’ll be adding more options for accessing data soon but for now this is the intended usage:
// Load the spreadsheet reader library
$this->load->library('excel_reader');
// Read the spreadsheet via a relative path to the document
// for example $this->excel_reader->read('./uploads/file.xls');
$this->excel_reader->read('path/to/file.xls');
// Get the contents of the first worksheet
$worksheet = $this->excel_reader->worksheets[0];
Excel_reader.php:
Please post any feedback to this thread: http://www.codeigniter.com/forums/viewthread/47299/
