PHPOffice/PhpSpreadsheet get cell column index as integer

12,221

Solution 1

please see Accessing cells

$ColumnIndex = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFromString($Column);

Solution 2

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

Go read the source in Github

Share:
12,221
user08
Author by

user08

Updated on June 13, 2022

Comments

  • user08
    user08 almost 2 years

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

  • Pierre-Olivier Vares
    Pierre-Olivier Vares about 3 years
    This is a first step, which I think OP had found. But getColumn and getCoordinate return strings. OP asked for integer values :)