Difference between & and && in PHP

后端 未结 6 2141
面向向阳花
面向向阳花 2020-11-30 03:21

I am confused with & and &&. I have two PHP books. One says that they are same, but the another says they are different. I thought they

6条回答
  •  迷失自我
    2020-11-30 04:22

     
    
    AND operation: 
    
    & -> will do the bitwise AND operation , it just doing operation based on
          the bit values. 
    &&   -> It will do logical AND operation. It is just the check the values is 
           true or false. Based on the boolean value , it will evaluation the 
           expression 
    

提交回复
热议问题