PHP的<>操作员 [英] PHP's <> operator

查看:60
本文介绍了PHP的<>操作员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<>运算符的确切含义是什么?

What does the <> operator mean exactly?

!=是否相同(不相等)?

Is it the same as != (not equal)?

$foo = 'text';

if ($foo <> 'photo') {
    echo 'foo';
}
else {
    echo 'bar';
}

推荐答案

如NikiC所述,<>和!=相同,并且具有相同的优先级.我之前的答案是基于文档中似乎有错误的错误,现已更正.

As NikiC notes, <> and != are the same and have the same precedence. My earlier answer was based on what appears to be a bug in the documentation which has now been corrected.

这篇关于PHP的&lt;&gt;操作员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆