code: public static function stringFromColumnIndex($columnIndex)
      {
          static $indexCache = [];
  
          if (!isset($indexCache[$columnIndex])) {
              $indexValue = $columnIndex;
              $base26 = null;
              do {
                  $characterValue = ($indexValue % 26) ?: 26;
                  $indexValue = ($indexValue - $characterValue) / 26;
                  $base26 = chr($characterValue + 64) . ($base26 ?: '');
              } while ($indexValue > 0);
              $indexCache[$columnIndex] = $base26;
          }
  
          return $indexCache[$columnIndex];
      }
docs: String from column index.
  
  @param int $columnIndex Column index (A = 1)
  
  @return string