- 09-07-2011 01:06 PM #1Junior Member Array
- Join Date
- Feb 2011
- Posts
- 19
- Thanks
- 0
- Thanked 0 Times in 0 Posts
Simplest way to convert binary number into a hexadecimal number !
Most of the time you try to convert a binary number, sequence of 1 and 0 to hexadecimal. I've found the simplest, one-line, code to do it

here I convert binary to decimal and then decimal to hexadecimal using built-in fuctions.PHP Code:<?php
echo dechex(bindec(1010));
//output : A
?>
- 11-24-2011 05:12 AM #2WTF Groupie Array
- Join Date
- Oct 2011
- Posts
- 349
- Thanks
- 0
- Thanked 2 Times in 2 Posts
use bin2hex








LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks