Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPOffice/PhpSpreadsheet get cell column index as integer

How can I get cell column index as integer? I have searched the documentation but I didn't found anything.

like image 431
Jona Avatar asked Apr 18 '18 11:04

Jona


2 Answers

please see Accessing cells

$ColumnIndex = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFromString($Column);
like image 83
saeed yadgari Avatar answered Sep 18 '22 12:09

saeed yadgari


If you have a cell then you can use the public functions - getColumn(), getRow(), getCoordinate()

Go read the source in Github

like image 40
jhoskins98 Avatar answered Sep 22 '22 12:09

jhoskins98