Definition
The bin2hex() function converts binary data into hexadecimal values.
Syntax
bin2hex(string)
Parameters
Parameter | Description |
---|---|
string |
Required. The string to be converted. |
Example
<?php
$str = "Hello world!";
echo bin2hex($str);