PHP dechex() Function Example

PHP dechex() Function Example


Posted in : PHP Posted on : January 28, 2011 at 6:26 PM Comments : [ 0 ]

In PHP, The dechex() function used for conversion decimal number to a hexadecimal number.

PHP dechex() Function Example:

In PHP, The dechex() function used for conversion decimal number to a hexadecimal number.

Syntax:

dechex(decimal_number)

where decimal_number is a decimal number passed as argument in this function.

Example:

<?php
$return = dechex(1234567);
echo "The value of dechex(1234567) is : " . $return . "<br />";

$return_value1 = dechex(7890);
echo "The value of dechex(7890) is : " . $return_value1;
?>

After running this example output is:

Output:

The value of dechex(1234567) is : 12d687
The value of dechex(7890) is : 1ed2

Download Example Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics