Software Development Resources
Create account | Log in | Log in with OpenID | Help

PHP/base convert

From DocForge

< PHP

base_convert is a PHP function which converts numbers between bases.

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

base_convert returns a string containing $number converted from base $frombase (the base of $number) to base $tobase. $frombase and $tobase must be between 2 and 36, inclusive. Digits in numbers with a base higher than 10 will be represented with the letters a-z (a = 10, b = 11, etc.).

Discuss