Convert a string value from binary to hex and back in PHP
Description
The following code shows how to convert a string value from binary to hex and back.
Example
//from w w w.ja va 2s . c o m
<?php
$str = "Hello world!";
echo bin2hex($str) . "<br>";
echo pack("H*",bin2hex($str)) . "<br>";
?>
The code above generates the following result.