September 2001
Intermediate to advanced
768 pages
32h 45m
English
string base_convert(string s, int source_base, int destination_base)
| s | Original value |
| source_base | Original base of number |
| destination_base | Base to which to convert |
Converts a number from one base to another.
Returns:
String representation of the converted number; FALSE on error
Description:
base_convert() returns a string representation of the number passed as the first argument. Valid values for source and destination bases can be from 2 to 36. Remember that PHP integers are signed 32-bit numbers, so the maximum value usable here is 2147483647.
Version:
PHP 3 since 3.0.6, PHP 4
See also:
bindec() decbin() dechex() hexdec() decoct() octdec()
Example:
$org = "564"; $new = base_convert($org, 8, 16); ... |
Read now
Unlock full access