Check whether K | PHP program to check if k - th bit of a given number is set or not ; Driver code
< ? php function isKthBitSet ( $ n , $ k ) { if ( $ n & ( 1 << ( $ k - 1 ) ) ) echo " SET " ; else echo " NOT ▁ SET " ; } $ n = 5 ; $ k = 1 ; isKthBitSet ( $ n , $ k ) ; ? >