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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -