How to convert a byte array to a hexadecimal string in PHP?
How to convert an array of bytes to a hex string
$arr = array(14, 0, 1, 0, 0, 0, 0, 0, 0, 224, 0, 255, 255, 255, 255, 255);
$hex_str = "";
foreach ($arr as $byte)
{
$hex_str .= sprintf("%02X", $byte);
}
Example
$chars = array_map("chr", $arr);
Then make it a string:
$bin = join($chars);
And finally convert that to a hex string:
$hex = bin2hex($bin);