text: Count trailing zero bits using lookup table | Simple PHP code for counting trailing zeros in binary representation of a number ; Driver Code
code: < ? php function countTrailingZero ( $ x ) { $ count = 0 ; while ( ( $ x & 1 ) == 0 ) { $ x = $ x >> 1 ; $ count ++ ; } return $ count ; } echo countTrailingZero ( 11 ) , " STRNEWLINE " ; ? >