Search w3schools.com:

SHARE THIS PAGE

PHP dechex() Function


PHP Math Reference Complete PHP Math Reference

Definition and Usage

The dechex() function converts a decimal number to a hexadecimal number.

Syntax

dechex(dec_number)

Parameter Description
dec_number Required. Specifies the decimal number to convert


Example

<?php
echo dechex("30") . "<br />";
echo dechex("10") . "<br />";
echo dechex("1587") . "<br />";
echo dechex("70");
?>

The output of the code above will be:

1e
a
633
46


PHP Math Reference Complete PHP Math Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]