php中or ,and的作用及使用
2020-12-13 01:45
阅读:575
标签:blog class code c 2014 使用
关于or,and的使用,查资料得知:and相当于then,or相当于else
下面通过举例来理解这两个关键字的使用:
比如:【1】
$isRight or $a=1000;
他与下面这段代码是等价的:
if(isRight==true) { } else { $a=1000; }
【2】
$update and $db_factory=1;
等价于:
if($update==true) { $db_factory=1; }
【3】
$aa and $b=1 or $c=1
等价于:
if ($aa) { $b=1 } else { $c=1 }
php中or ,and的作用及使用,搜素材,soscw.com
php中or ,and的作用及使用
标签:blog class code c 2014 使用
原文地址:http://blog.csdn.net/jijunyuan/article/details/24989259
评论
亲,登录后才可以留言!