PHP: hexdec() function
Description
The hexdec() function is used to convert a hexadecimal number to a decimal number.
Version:
(PHP 4 and above)
Syntax:
hexdec(num)
Parameter:
Name | Description | Required / Optional |
Type |
---|---|---|---|
num | The hexadecimal string to convert. | Required | String |
Return value:
The decimal representation of num.
Value Type: Integer/Float.
Pictorial Presentation
Example:
<?php
echo hexdec("1f")."<br>";
echo hexdec("b")."<br>";
echo hexdec("11aa")."<br>";
echo hexdec("aaccee");
?>
Output:
31 11 4522 11193582
View the example in the browser
See also
Previous: getrandmax
Next: hypot
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics