1 | <?php |
||
9 | class CellHelper |
||
10 | { |
||
11 | /** @var array Cache containing the mapping column index => column letters */ |
||
12 | private static $columnIndexToColumnLettersCache = []; |
||
13 | |||
14 | /** |
||
15 | * Returns the column letters (base 26) associated to the base 10 column index. |
||
16 | * Excel uses A to Z letters for column indexing, where A is the 1st column, |
||
17 | * Z is the 26th and AA is the 27th. |
||
18 | * The mapping is zero based, so that 0 maps to A, B maps to 1, Z to 25 and AA to 26. |
||
19 | * |
||
20 | * @param int $columnIndexZeroBased The Excel column index (0, 42, ...) |
||
21 | * |
||
22 | * @return string The associated cell index ('A', 'BC', ...) |
||
23 | */ |
||
24 | 37 | public static function getColumnLettersFromColumnIndex($columnIndexZeroBased) |
|
46 | } |
||
47 |