In PHP, The dechex() function used for conversion decimal number to a hexadecimal number.
PHP dechex() Function Example:
In PHP, The dechex() function used for conversion decimal number to a hexadecimal number.
Syntax:
dechex(decimal_number)
where decimal_number is a decimal number passed as argument in this function.
Example:
<?php $return = dechex(1234567); echo "The value of dechex(1234567) is : " . $return . "<br />"; $return_value1 = dechex(7890); echo "The value of dechex(7890) is : " . $return_value1; ?>
After running this example output is:
Output:
The value of dechex(1234567) is : 12d687 The value of dechex(7890) is : 1ed2
[ 0 ] Comments