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

Hexdec () PHP Function

By Angela Bradley, About.com

Definition: The Hexdec () PHP Function is used to convert a hexadecimal number into a decimal number. The function will ignore any non-hex characters it encounters. The opposite function Dechex () will convert a decimal into a hexadecimal number.
Also Known As: hexadecimal
Examples:
<?php
echo(hexdec(1) . "<br />");
echo(hexdec(e3e) . "<br />");
echo(hexdec(fffffff) . "<br />");
echo(hexdec(d7d) . "<br />");
?>
This will return:
1
3646
268435455
3453
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. Hexdec PHP Function - Convert a hexadecimal into a decimal

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

All rights reserved.