Home > php教程 > php手册 > php中&&与&有什么区别

php中&&与&有什么区别

WBOY
Release: 2016-06-13 11:34:16
Original
1551 people have browsed it

第一个:&&是逻辑运算符,代表“并且”也就是常说的 AND。常见的还有如下几个:

!$a Not(逻辑非) TRUE,如果 $a 不为 TRUE。

$a && $b And(逻辑与) TRUE,如果 $a 与 $b 都为 TRUE。

$a || $b Or(逻辑或) TRUE,如果 $a 或 $b 任一为 TRUE。
---------
第二个:&是位运算符,$c = $a & $b, 将把 $a 和 $b 的二进制位中都为 1 的位设为 1。
如5&3 =>101 & 11 这个是二进制

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template