paip.php and or 语句用法作用

paip.php and or 语句用法作用
作者Attilax , 1466519819@qq.com 

今天修改一个PHP文件 ,有以下语法:
$order_id or $create = 1; 






经过查找资料,原来它想当于这样的写法..AND 相当于THEN,OR想当于ELSE
if($order_id==true)
{}
else
{ $create = 1; }






示例2:$update and $db_factory=1;
相当于
  if($update==true)  then


 $db_factory=1;










示例3: $aa and $b=1 or $c=1


相当于if ($aa)
       
$b=1 


else


 $c=1
posted @ 2013-03-17 00:40  attilaxAti  阅读(18)  评论(0编辑  收藏  举报