PHP bin2hex() Function
by Rekha[ Edit ] 2010-01-28 18:26:49
The bin2hex() function converts a string of ASCII characters to hexadecimal values. The string can be converted back using the pack() function.
Syntax:
bin2hex(string)
Example:
<?php
$str = "Hello world!";
echo bin2hex($str);
?>
The output of the code above will be:
48656c6c6f20776f726c6421