1. Computing & Technology

Discuss in my forum

Hexdec () PHP Function

By , About.com Guide

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

©2012 About.com. All rights reserved.

A part of The New York Times Company.