1. Home
  2. Computing & Technology
  3. PHP / MySQL

Dechex () PHP Function

By Angela Bradley, About.com

Definition: The Dechex () PHP Function is used to convert a decimal number into a hexadecimal number. It can be converted back again used the hexdec () function. The highest number that can be converted is 4294967295 which will return the hexadecimal ffffffff.
Also Known As: Hexadecimal
Examples:
<?php
echo(dechex(1) . "<br />");
echo(dechex(1006) . "<br />");
echo(dechex(4294967295) . "<br />");
echo(dechex(3453) . "<br />");
?>
This returns the following:
1
3ee
ffffffff
d7d
Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. PHP Functions
  5. Dechex PHP Function - Convert a decimal into a hexadecimal number

©2009 About.com, a part of The New York Times Company.

All rights reserved.