bin2hex
Convert binary data into hexadecimal representation
Description
string bin2hex(string $string
)
Parameters
-
string
-
A string.
Return Values
Returns the hexadecimal representation of the given string.
Examples
Example #1 bin2hex example
<?php
$hex = bin2hex('Hello world!');
var_dump($hex);
var_dump(hex2bin($hex));
?>
The above example will output:
string(24) "48656c6c6f20776f726c6421"
string(12) "Hello world!"