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

 Live Demo

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

Output

13<br>14735

Updated on: 26-Jun-2020

87 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements