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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -