I want to convert a "hex" String: $hexstring = "8F21FF434927";
into its ascii code: !ÿCI'
I found simple hex2str Methodes but they do an output like: 0x8F 0x21...
I want to convert a "hex" String: $hexstring = "8F21FF434927";
into its ascii code: !ÿCI'
I found simple hex2str Methodes but they do an output like: 0x8F 0x21...
function hexToStr($hex){
$string='';
for ($i=0; $i < strlen($hex)-1; $i+=2){
$string .= chr(hexdec($hex[$i].$hex[$i+1]));
}
return $string;
}
echo hexToStr("8F21FF434927");