PHP bin2hex() function is used to convert binary data into equalant hexadecimal.
Syntax
string bin2hex(str);
Parameter | Description |
---|---|
str : | Required parameter. A string or text. |
Return Value : | Returns the hexadecimal representation of the given string. |
<?php echo bin2hex("Hello world!"); ?>