base_convert

(PHP 3>= 3.0.6, PHP 4 )

base_convert -- 임의의 베이스(arbitrary bases) 사이에서 숫자를 변환한다.

설명

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

number에 해당하는 문자열 tobase 베이스로 바꾸어 반환한다. number의 베이스는 frombase에서 명시된다. frombasetobase는 둘 다 2 보다 크거나 같고 36 보다 작거나 같은 값이 와야 한다. 10 보다 큰 숫자(digit) a에서 z 까지의 문자로 나타내며, a 는 10을 b는 11을 그리고 z는 35에 해당하는 숫자를 나타낸다.

예 1. base_convert()

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