문제

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

I would like to ask any solution for split the cell coordinate alphabet and integer?

e.g A1, A2,

I need to know currently which row, and until which column.

I do some research about split, but not luck for it. Any idea?

도움이 되었습니까?

해결책

This:

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

Will produce:

Array (
  [0] => Array (
    [0] => AF
    [1] => 13
  )
)

다른 팁

$coordinate = PHPExcel_Cell::coordinateFromString('A1');
var_dump($coordinate);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top