I'm using these 2 functions to convert hex to strings, and string to hex:
The problem is that if I convert the following:PHP Code:function convertASCIIToChr($theContent)
{
// http://au.php.net/bin2hex
if (!is_string($theContent)) return null;
$r='';
for ($a=0; $a<strlen($theContent); $a+=2) { $r.=chr(hexdec($theContent{$a}.$theContent{($a+1)})); }
return $r;
}
function convertChrToASCII($theContent)
{
return bin2hex($theContent);
}
I will get this on the other end:Code:<div class="someclass"> Sometext </div>
It took me a while to figure out why some of my classes weren't working, but I eventually got itCode:<div class=\"someclass\"> Sometext </div>.
Does anyone know a way around this?




.
Reply With Quote