PHP逻辑操作符

来源:互联网 发布:python读取ods文件 编辑:程序博客网 时间:2024/05/16 18:13
Logical OperatorsExampleNameResult$a and $bAndTRUE if both $a and $b are TRUE.$a or $bOrTRUE if either $a or $b is TRUE.$a xor $bXorTRUE if either $a or $b is TRUE, but not both.! $aNotTRUE if $a is not TRUE.$a && $bAndTRUE if both $a and $b are TRUE.$a || $bOrTRUE if either $a or $b is TRUE.

 

这个不用多少什么了。大家都清楚的很。

and 和&& 等价;

or 和|| 等价;

 

还有个就是那个不常用的逻辑操作符"xor"。有些逻辑使用这个操作符可以省很多。。

 

0 0