PHP hexdec () function
Examples
The hex to decimal:
<?php
echo hexdec("1e") . "<br>";
echo hexdec("a") . "<br>";
echo hexdec("11ff") . "<br>";
echo hexdec("cceeff");
?>
echo hexdec("1e") . "<br>";
echo hexdec("a") . "<br>";
echo hexdec("11ff") . "<br>";
echo hexdec("cceeff");
?>
Running instance »
Definition and Usage
hexdec () function to convert hexadecimal to decimal.
Tip: If you need to convert decimal to hexadecimal, check dechex () function.
grammar
hexdec( hex_string );
参数 | 描述 |
---|---|
hex_string | 必需。规定要转换的十六进制字符串。 |
technical details
return value: | hex_string the decimal value. |
---|---|
Return type: | Float / Integer |
PHP version: | 4+ |
PHP Math Reference