I have two decimal numbers. If both the bits at any identical positions are set, then comparison should return true otherwise false. For example
- number1 = 196 = 11000100
- number2 = 4 = 00000100
- number3 = 16 = 00010000
=> Comparison of number1 and number2 will return true.
=> Comparison of number1 and number3 will return false.
=> Comparison of number2 and number3 will return false.
In PHP, is there any inbuilt function for this type of comparison or how can we write custom logic for it?