php - php中的 "or"是什么意思?

标签 php syntax

<分区>

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.

参见 http://php.net/manual/en/language.operators.logical.php

关于php - php中的 "or"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5747383/

相关文章:

excel - excel中vba矩阵的语法

c# - C# 关键字什么时候不保留?

java - java中的Double {{ }}语法问题

php - 在 MySQL 中连接大表和小表会影响查询性能吗?

php - 共享主机上的 Laravel - 子域

php - 从其他 PHP 文件中移除 PHP 警告

php - jQuery - 单击链接/按钮时显示文本框

vb.net - 语法:VB.NET 子例程中的 "Exit Sub"或 "Return"

mysql - 不同的结果更新和选择使用加入 mysql

php - CodeIgniter session cookie 域