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: 2020-06-26T09:46:17+05:30

122 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements