2017-09-16 86 views
0

有两个不相等的运算符!=<>。它们是一样的吗?或者它们彼此略有不同?在php中两个不等于运算符有什么区别?

+1

http://php.net/manual/en/language.operators.comparison.php同样的事情我会说 – 2017-09-16 03:37:56

+0

在我的意见,请使用'!='来更多地与其他C-Base语言相似。 –

+0

@RC。对于有些问题我感到抱歉,这让我印象深刻,但是,类似地,'Null'和'Empty'有什么区别?谢谢。 –

回答

1

他们是平等的:http://php.net/manual/en/language.operators.comparison.php

$a != $b // Not equal TRUE if $a is not equal to $b after type juggling. 
$a <> $b // Not equal TRUE if $a is not equal to $b after type juggling. 
$a !== $b // Not identical TRUE if $a is not equal to $b, or they are not of the same type. 
1

没有区别。你可以在MSSQL中使用这两种。

The MSSQL doc says:

!=功能一样<>(不等于)比较 运算符。

<>ANSI 99 SQL standard!=定义是没有的。因此,不是所有的数据库引擎都可以支持它,如果你想生成便携式代码,我推荐使用<>.

+0

mssql从哪里来?问题的标签是php; o) – Jakumi

相关问题