X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP dechex() Function

PHP Math Reference PHP Math Reference

Example

Convert decimal to hexadecimal:

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

Run example »

Definition and Usage

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

Tip: To convert hexadecimal to decimal, look at the hexdec() function.


Syntax

dechex(number);

Parameter Description
number Required. Specifies the decimal value to convert

Technical Details

Return Value: A string that contains the hexadecimal number of the decimal value
Return Type: String
PHP Version: 4+


PHP Math Reference PHP Math Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook