In PHP, it is easy to convert Hexadecimal to Decimal. PHP provides hexdec() function which returns the decimal equivalent of the hexadecimal number represented by the hex_string argument.
echo hexdec("ab"); // 171
This method will ignore any non-hexadecimal characters in the provided string.
echo hexdec("abs"); // 171. It skips "s" in the string.
hexdec() converts numbers to integer type. If the number is too large to fit in integer type, it is converted to float one.
echo hexdec("AAA3453AADBBCCFFEE"); //3.1477113666501E+21