PHP hexdec() - Math Functions

What is hexdec Function?
How to convert hexadecimal value to binary in PHP?

Explanation

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

Syntax:


hexdec(hex_number)

In the above syntax "hex_number" is the hexadecimal number to be converted to decimal number.

Example :


<?php
echo hexdec(a) . "n";
echo hexdec(f);
?>
Result :

10
15

In the above example the hexadecimal numbers "a", "f" are converted to decimal numbers "10", "15".

PHP Topics


Ask Questions

Ask Question