src/Koldy/Convert/NumericNotation.php
public static function big2dec(string $alpha): string
    {
	    static::checkExtensionOrFail();

        if (strlen($alpha) <= 0) {
            throw new Exception('Got empty string in big2dec, can not proceed');
        }

        $alphabet = array_flip(static::NUMBERS);
        $mod = (string)count($alphabet);

        $x = '0';
        for ($i = 0, $j = strlen($alpha) - 1; $i < strlen($alpha); $i++, $j--) {
            $char = substr($alpha, $j, 1);
            $val = $alphabet[$char];

            $x = bcadd($x, bcmul((string)$val, bcpow($mod, (string)$i)));
        }

        return $x;
    }
public static function big2dec(string $alpha): string
    {
	    static::checkExtensionOrFail();

        if (strlen($alpha) <= 0) {
            throw new Exception('Got empty string in big2dec, can not proceed');
        }

        $alphabet = array_flip(static::NUMBERS);
        $mod = (string)count($alphabet);

        $x = '0';
        for ($i = 0, $j = strlen($alpha) - 1; $i < strlen($alpha); $i++, $j--) {
            $char = substr($alpha, $j, 1);
            $val = $alphabet[$char];

            $x = bcadd($x, bcmul((string)$val, bcpow($mod, (string)$i)));
        }

        return $x;
    }
public static function big2dec ( string $ alpha ) : string { static :: checkExtensionOrFail ( ) ; if ( strlen ( $ alpha ) <= 0 ) { throw new Exception ( 'Got empty string in big2dec, can not proceed' ) ; } $ alphabet = array_flip ( static :: NUMBERS ) ; $ mod = ( string ) count ( $ alphabet ) ; $ x = '0' ; for ( $ i = 0 , $ j = strlen ( $ alpha ) - 1 ; $ i < strlen ( $ alpha ) ; $ i ++ , $ j -- ) { $ char = substr ( $ alpha , $ j , 1 ) ; $ val = $ alphabet [ $ char ] ; $ x = bcadd ( $ x , bcmul ( ( string ) $ val , bcpow ( $ mod , ( string ) $ i ) ) ) ; } return $ x ; }
The reverse procedure, convert number from your numeric system into decimal number

@param string $alpha

@return string because real number can reach the MAX_INT
@throws Exception
@throws ExtensionException
@example ax1 is 40487
The reverse procedure convert number from your numeric system into decimal number