I am reading data from a simple spreadsheet but getCell()
returns all the data from a row and not just the indicated cell.
For example, I have a spreadsheet with random text in the first few cells.
__A__ __B__ __C__ __D__ __E__ 1 | aa | bb | cc | dd | ee | 2 |_____|_____|_____|_____|_____|
I fire up PHPExcel and run this code:
$objReader = PHPExcel_IOFactory::createReaderForFile($file);
$objPHPExcel = $objReader->load($file);
$foo = $objPHPExcel->getActiveSheet()->getCellByColumnAndRow('A', 1)->getValue();
$bar = $objPHPExcel->getActiveSheet()->getCell('A1')->getValue();
The result for both $foo
and $bar
is one string of all the values:
aa bb cc dd ee
Why is this happening? Thanks.
PHP v5.3.13
PHPExcel v1.7.9