PHP bin2hex() function

The bin2hex() function decodes a hexadecimally encoded binary data to ASCII characters.


hex2bin ( string $string ) : string


Parameter Name Descrption
$string Required, The hexadecimal data

Return Value

Returns the ASCII character of the converted data on success or FALSE on failure.

bin2hex() examples

echo hex2bin("5465737420537472696e67");
//Output :: Test String

Related Functions

  • bin2hex(): Convert binary data into hexadecimal representation