PHP bin2hex() Function

The bin2hex() function converts a string of ASCII characters to hexadecimal values. The string can be converted back using the pack() function.

Example

$str = bin2hex("Hello World!");
echo($str); 

Output

48656c6c6f20576f726c6421

Leave a Reply

Your email address will not be published. Required fields are marked *