base_convert

(PHP 3>= 3.0.6, PHP 4 >= 4.0.0)

base_convert -- 任意の基底に変換する

説明

strin base_convert (string number, int frombase, int tobase)

number を基底 tobase で表した文字列を返します。 number の基底は、 frombase で指定します。 frombase および tobase は共に2から36までである必要があります。 10 より大きな基底を有する数の各桁は、文字 a-z で表されます。 この場合、a は 10、b は 11、z は 36 を意味します。

例 1base_convert()


$binary = base_convert($hexadecimal, 16, 2);