I'm doing these comparisons to see what options are enabled but the PHP is returning wrong values. I'm exactly checking what banks were enabled by the user.
Próprio = 1
Itaú = 2
Bradesco = 4
Santander = 8
Caixa Econômica Federal = 16
HSBC = 32
When I load the data from MySQL, I've get 16, so only Caixa is turned on, but PHP says that Próprio and HSBC it turned on too. I've made other tests and I received the following results:
1 & 1 = true
1 & 2 = false
1 & 4 = false
1 & 8 = false
1 & 16 = true
1 & 32 = true
2 & 1 = false
2 & 2 = true
2 & 4 = false
2 & 8 = false
2 & 16 = false
2 & 32 = true
4 & 1 = false
4 & 2 = false
4 & 4 = true
4 & 8 = false
4 & 16 = false
4 & 32 = false
8 & 1 = false
8 & 2 = false
8 & 4 = false
8 & 8 = true
8 & 16 = false
8 & 32 = false
16 & 1 = true
16 & 2 = false
16 & 4 = false
16 & 8 = false
16 & 16 = true
16 & 32 = true
32 & 1 = true
32 & 2 = true
32 & 4 = false
32 & 8 = false
32 & 16 = true
32 & 32 = true
Thanks in advance for any help.
var_dump(1 & 32); int(0). Whats the exact code you use?