dechex() function in PHP


The dechex() function converts decimal to hexadecimal. It Returns the hexadecimal string of the specified decimal.

Syntax

dechex(num)

Parameters

  • num − The decimal value to be converted

Return

The dechex() function Returns the hexadecimal string of the specified decimal.

Example

 Live Demo

<?php
   echo dechex("15") . "<br>";
   echo dechex("1990");
?>

Output

f<br>7c6

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 26-Jun-2020

28 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements