Computer >> Computer tutorials >  >> Programming >> PHP

hexdec() function in PHP


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

Syntax

hexdec(val)

Parameters

  • val − The hexadecimal to be converted.

Return

The hexdec() function Returns the decimal value of val, which is hexadecimal.

Example

<?php
   echo hexdec("d") . "<br>";
   echo hexdec("398f");
?>

Output

13<br>14735