tags:

views:

109

answers:

1

PHPExcel $cell->getColumn() returns 'A', 'B', 'C', ...

which is the best way to get the integer (0, 1, 2, ...) from the cell.

This function doesn't exist.

$colIndex = $cell->getColumnIndex();

So what is the alternative withoput converting chr to ascii ?

A: 
$colIndex = PHPExcel_Cell::columnIndexFromString($cell->getColumn());
Mark Baker
OK works fine, I notice that the value returned is 1 for column A but $cell = "worksheet->getCellByColumnAndRow($col, $row);uses 0 for column Ago figure
john Griffiths
Yup, quirky... something I inherited when I took over the development of PHPExcel, but changing it would break backward compatibility for a lot of people
Mark Baker