Count total bits in a number | Function to get no of bits in binary representation of positive integer ; Driver Code
< ? php function countBits ( $ n ) { $ count = 0 ; while ( $ n ) { $ count ++ ; $ n >>= 1 ; } return $ count ; } $ i = 65 ; echo ( countBits ( $ i ) ) ; ? >