Table of Contents

Syntax

string bin2hex(int $val)

(PHP 4, PHP 5)

$val The integer (long) number to convert to hexadecimal
RETURNS Returns a hexadecimal string converted from the argument

What it Does

Converts binary data into a hexadecimal string equivalent. Hexadecimal is a base 16 numbering system with digits from 0 - 9 A - F. The number 31 in hexadecimal would be 1F which is sometimes represented as 0x1F or 1FH.

Example

echo bin2hex(31);

Outputs:

1f
 
bin2hex.txt · Last modified: 2008/04/18 14:00 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki