public static function baseFromDec($input, $Chars)
    {
        if (preg_match('/^[0-9]+$/', $input))
        {
            $Result = '';
            do
            {
                $Result .= $Chars[bcmod($input, strlen($Chars))];
                $input = bcdiv($input, strlen($Chars), 0);
            }
            while (bccomp($input, '0') != 0);

            return strrev($Result);
        }
        return false;
    }
public static function baseFromDec($input, $Chars)
    {
        if (preg_match('/^[0-9]+$/', $input))
        {
            $Result = '';
            do
            {
                $Result .= $Chars[bcmod($input, strlen($Chars))];
                $input = bcdiv($input, strlen($Chars), 0);
            }
            while (bccomp($input, '0') != 0);

            return strrev($Result);
        }
        return false;
    }
public static function baseFromDec ( $ input , $ Chars ) { if ( preg_match ( '/^[0-9]+$/' , $ input ) ) { $ Result = '' ; do { $ Result .= $ Chars [ bcmod ( $ input , strlen ( $ Chars ) ) ] ; $ input = bcdiv ( $ input , strlen ( $ Chars ) , 0 ) ; } while ( bccomp ( $ input , '0' ) != 0 ) ; return strrev ( $ Result ) ; } return false ; }
convert character string with decimal base to arbitrary base
@param string $input        decimal string
@param string $Chars
@return string|boolean
convert character string with decimal base to arbitrary base