Find most significant set bit of a number | PHP program to find MSB number for given n . ; To find the position of the most significant set bit ; To return the the value of the number with set bit at k - th position ; Driver code
< ? php function setBitNumber ( $ n ) { $ k = ( int ) ( log ( $ n , 2 ) ) ; return 1 << $ k ; } $ n = 273 ; echo setBitNumber ( $ n ) ; ? >