PHP hexdec() Function
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