X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP hexdec() Function

PHP Math Reference PHP Math Reference

Example

Convert hexadecimal to decimal:

<?php
echo hexdec("1e") . "<br>";
echo hexdec("a") . "<br>";
echo hexdec("11ff") . "<br>";
echo hexdec("cceeff");
?>

Run example »

Definition and Usage

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

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


Syntax

hexdec(hex_string);

Parameter Description
hex_string Required. Specifies the hexadecimal string to convert

Technical Details

Return Value: The decimal value of hex_string
Return Type: Float / Integer
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

SHARE THIS PAGE

facebook