Forum Moderators: coopster
What I need to do is view their binary representation.
I've been playing around with unpack, but can't seem to get anywhere. Google hasn't helped a bit.
Like, if I just had "e" how could I convert that to "01100101"?
Thanks,
Adam
Though I did find this nifty function, that converts ascii to binary, in the process if it's ever userful to anyone: (i didn't make it nor do i remember where i found it, lots of google pages)
function asc2bin ($ascii)
{
while ( strlen($ascii) > 0 )
{
$byte = "";
$i = 0;
$byte = substr($ascii, 0, 1);
while ( $byte!= chr($i) ) { $i++; }
$byte = base_convert($i, 10, 2);
$byte = str_repeat("0", (8 - strlen($byte)) ) . $byte; /* This is an endian (architexture) specific line, you may need to alter it. */
$ascii = substr($ascii, 1);
$binary .= $byte." ";
}
return $binary;
}