binary - Show the 8 bits of a byte in PHP -
i wondering if there easy way display 8 bits of byte(or char) in php.
for example ascii encoding character '0' should return 0011 0000
thanks input!
this should job:
$bin = decbin(ord($char)); $bin = str_pad($bin, 8, 0, str_pad_left);
Comments
Post a Comment