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
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/php/function-reference/hexdec.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics