Php PHPExcel split Excel cell coordinate

Currently I used PHPExcel to import an excel file, there is a function $cell->getCoordinate();

I would like to ask any solution for separating the cell coordinates of alphabet and integer ?

e.g. A1, A2,

I need to know which row and to which column.

I am studying schism, but not luck. Any idea?

+4
source share
2 answers

It:

 $coord = 'AF13'; preg_match_all('~[AZ]+|\d+~', $coord, $split); print_r($split); 

Will produce:

 Array ( [0] => Array ( [0] => AF [1] => 13 ) ) 
+4
source
 $coordinate = PHPExcel_Cell::coordinateFromString('A1'); var_dump($coordinate); 
+2
source

Source: https://habr.com/ru/post/1305626/


All Articles