在php中两个不等于运算符有什么区别?
答
他们是平等的: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.
答
没有区别。你可以在MSSQL中使用这两种。
!=
功能一样<>
(不等于)比较 运算符。
但<>
在ANSI 99 SQL standard和!=
定义是没有的。因此,不是所有的数据库引擎都可以支持它,如果你想生成便携式代码,我推荐使用<>.
+0
mssql从哪里来?问题的标签是php; o) – Jakumi
http://php.net/manual/en/language.operators.comparison.php同样的事情我会说 – 2017-09-16 03:37:56
在我的意见,请使用'!='来更多地与其他C-Base语言相似。 –
@RC。对于有些问题我感到抱歉,这让我印象深刻,但是,类似地,'Null'和'Empty'有什么区别?谢谢。 –