<分区>
Possible Duplicate:
PHP - and / or keywords
我看到一些 PHP 代码以我不熟悉的方式使用 或
。例如:
fopen($site,"r") or die("Unable to connect to $site");
这是否等于此 ||
?
为什么要使用这个而不是 try catch
block ?什么会导致程序运行 or die()
?
<分区>
Possible Duplicate:
PHP - and / or keywords
我看到一些 PHP 代码以我不熟悉的方式使用 或
。例如:
fopen($site,"r") or die("Unable to connect to $site");
这是否等于此 ||
?
为什么要使用这个而不是 try catch
block ?什么会导致程序运行 or die()
?
最佳答案
大部分情况下是这样,但是...
The reason for the two different variations of "and" and "or" operators is that they operate at different precedences.
关于php - php中的 "or"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5747383/