We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 32efe0e + 55f03a5 commit 4d5a482Copy full SHA for 4d5a482
src/PhpSpreadsheet/Cell/Coordinate.php
@@ -324,14 +324,15 @@ public static function columnIndexFromString($columnAddress)
324
public static function stringFromColumnIndex($columnIndex)
325
{
326
static $indexCache = [];
327
+ static $lookupCache = ' ABCDEFGHIJKLMNOPQRSTUVWXYZ';
328
329
if (!isset($indexCache[$columnIndex])) {
330
$indexValue = $columnIndex;
331
$base26 = '';
332
do {
333
$characterValue = ($indexValue % 26) ?: 26;
334
$indexValue = ($indexValue - $characterValue) / 26;
- $base26 = chr($characterValue + 64) . $base26;
335
+ $base26 = $lookupCache[$characterValue] . $base26;
336
} while ($indexValue > 0);
337
$indexCache[$columnIndex] = $base26;
338
}
0 commit comments