public static function alpha2num($a)
    {
        $r = 0;
        $l = strlen($a);
        for ($i = 0; $i < $l; $i++) {
            $r += pow(26, $i) * (ord($a[$l - $i - 1]) - 0x40);
        }
        return $r;
    }
public static function alpha2num($a)
    {
        $r = 0;
        $l = strlen($a);
        for ($i = 0; $i < $l; $i++) {
            $r += pow(26, $i) * (ord($a[$l - $i - 1]) - 0x40);
        }
        return $r;
    }
public static function alpha2num ( $ a ) { $ r = 0 ; $ l = strlen ( $ a ) ; for ( $ i = 0 ; $ i < $ l ; $ i ++ ) { $ r += pow ( 26 , $ i ) * ( ord ( $ a [ $ l - $ i - 1 ] ) - 0x40 ) ; } return $ r ; }
Alpha to Number

Optimizing from \PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFromString()

@example
A => 1, AA => 27
@param int $n Excel column alpha
@return string column number
Alpha to Number