Loader

bin2hex

Returns an ASCII string containing the hexadecimal representation of string. The conversion is done byte-wise with the high-nibble first. Test bin2hex online.

string bin2hex ( string $str )

PHP Documentation by the PHP Documentation Group

bin2hex

(PHP 4, PHP 5, PHP 7)

bin2hexConvert binary data into hexadecimal representation

Description

bin2hex ( string $str ) : string

Returns an ASCII string containing the hexadecimal representation of str. The conversion is done byte-wise with the high-nibble first.

Parameters

str

A string.

Return Values

Returns the hexadecimal representation of the given string.

See Also

  • hex2bin() - Decodes a hexadecimally encoded binary string
  • pack() - Pack data into binary string

PHP Documentation

Copyright © 1997 - 2016 by the PHP Documentation Group. This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution 3.0 License or later. A copy of the Creative Commons Attribution 3.0 license is distributed with this manual. The latest version is presently available at » http://creativecommons.org/licenses/by/3.0/.