string dechex(int $number);
Parameter | DESCRIPTION |
$number | Required : Decimal number as Input to convert to equivalent hexadecimal number. |
The output is string converted to hexadecimal base system.
Hexadecimal is positional numeral system with base of 16. The chars it used are from 0 to 9 and from A to F.
Example : Decimal to hexadecimal
<?Php
echo dechex(2); // Output 2
echo "<br>";
echo dechex(25); // Output 19
echo "<br>";
echo dechex(200); // Output is c8
echo "<br>";
echo dechex(358); // Output is 166
echo "<br>";
echo dechex(2000); // Output is 7d0
?>
← Subscribe to our YouTube Channel here