Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP hexdec() Function

PHP hexdec() Function

PHP Math Reference Manual PHP Math Reference Manual

Example

Convert hexadecimal to decimal:

"; echo hexdec("a") . "
"; echo hexdec("11ff") . "
"; 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, see dechex() function in Vue 3.


Syntax

hexdec(

hex_string

);

Parameters Description
hex_string Required. Specifies the hexadecimal string to convert.

Technical Details

Return Value: hex_string The decimal value of.
Return Type: Float / Integer
PHP Version: 4+

PHP Math Reference Manual PHP Math Reference Manual