Home  >  Article  >  Backend Development  >  The difference between && and & operations in php

The difference between && and & operations in php

不言
不言Original
2018-04-09 16:57:163992browse

本篇文章给大家分享的是关于php中&&与&运算的区别 ,有需要的朋友可以参考一下
&&是逻辑运算”与“,参加运算的两个量理解为逻辑值TRUE、FALSE在进行运算,两个值都为TRUE时结果为TRUE,否则结果为FALSE,例如:3 && 5的结果为TRUE。

&是数学运算”按位与“,参加运算的两个数的二进制形式,每一个二进制位进行”与“运算,最后的结果二进制作为结果,例如:3 & 5=1,因为3和5的二进制分别是0011、0101,两个进行与运算的结果是0001。

               

The above is the detailed content of The difference between && and & operations in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn