Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPExcel how to get column index from cell

Tags:

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 ?

like image 384
john Griffiths Avatar asked Aug 11 '10 13:08

john Griffiths


1 Answers

$colIndex = PHPExcel_Cell::columnIndexFromString($cell->getColumn()); 
like image 185
Mark Baker Avatar answered Sep 17 '22 15:09

Mark Baker