PHP & Excel

April 11, 2008 at 12:06 pm | In CakePHP, Uncategorized | Leave a Comment
Tags: , , ,

PhpExcel reader is good wrapper to read data from excel file. I have used this in one of my CakePHP project.

This is component class

class ExcelComponent
{
var $file = "";
var $setOutputEncoding = "UTF-8";
var $data;
var $controller;function startup( &$controller )
{
$this->controller = &$controller;
}function read()
{
vendor('Excel'.DS.'reader');
$this->data = new Spreadsheet_Excel_Reader();
$this->data->setOutputEncoding = $this->setOutputEncoding;
$this->data->read($this->file);
}
}

?>

  • http://sourceforge.net/projects/phpexcelreader

No Comments Yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.