>!= PHP运算符,不等于或大于怎么写?
如何在 PHP 中编写不大于或等于?
是 >!=
吗?
How can I write not greater-than-or-equal-to in PHP?
Is it >!=
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何在 PHP 中编写不大于或等于?
是 >!=
吗?
How can I write not greater-than-or-equal-to in PHP?
Is it >!=
?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(13)
不大于或等于 x
与小于 x
不一样吗?Isn't
not greater than or equal to x
the same asless than x
?哦,有趣。按照复杂性递增的顺序:
就我个人而言,我会为那些真正惹恼我的人保留#8。 ;)
Oh, fun. In increasing order of complexity:
Personally, I would reserve #8 for someone who really annoyed me. ;)
最好的写法是
The best way to write this is
“不大于或等于”相当于“严格小于”,即
<
。如果你真的想说“不大于或等于”,你可以直接写
!(a >= b)
。"not greater than or equal to" is equivalent to "strictly less than" which you write as
<
.If you really wanted to say "not greater than or equal to" you could just write
!(a >= b)
.(小于等于不大于或等于)
(less than is the same as not greater than or equal to)
从技术上讲,您提出了两个不同的问题 - 如何编写
A不大于B或A等于B
和A不等于B或A大于B
。语句
A不大于B或A等于B
意味着:这是一个同义反复:
并且
A不等于B或A大于B
意味着:这是一个同义反复:
A
A <的其他答案B
代表语句A 不大于也不等于B
。Technically, you have asked two different questions - how to write
A not greater than B or A equal to B
andA not equal to B or A greater than B
.The statement
A not greater than B or A equal to B
implies:which is a tautology for:
And
A not equal to B or A greater than B
implies:which is a tautology for:
The other answers of
A < B
are representative of the statementA not greater than nor A equal to B
.只需使用
<
?simply use
<
?为了向不相信的人证明小于与不大于或等于不同:
它在我的系统上输出:
To prove the disbelievers that less than is different than not greater or equal:
It outputs this on my system:
a
不大于或等于b
相当于b
b
b
a
一个a
not greater or equal tob
is equivalent tob < a
看一下这个页面: http://www.php.net /manual/en/language.operators.logic.php
它显示了有关运算符的有趣的事情以及如何使用它们...我突出显示了这个特定的逻辑运算符页面,因为当您使用这些运算符时,这些运算符尤其具有不同的行为使用它们的相似词,例如“||”和“或”。
值得一看=)
Take a look at this page: http://www.php.net/manual/en/language.operators.logical.php
It shows interesting things about operators and how to use them... I've highlighted this specific logical operators page because these, in particular, has different behaviors when you use their similars, like "||" and "or".
It's worth to take a look =)
按照您所说的方式去做
!>或<>
Doing it the way you word it
!> or <>
一些简单的例子:
Some simple example :
假设您想要测试 A 不等于或大于 B;
假设:
对于正常比较,代码将如下所示:
如果使用给定值执行上面的代码,那么我们期望语句
A 和 B 不等于
,因为 10 不大于或等于20.现在要测试 A >= B 的反转或否定版本,我们只需在表达式中添加 NOT 符号 (!) 即可实现反转。
运行上述代码的预期响应是返回语句
A 和 B 不相等
。Given that you want to test that A is not equal or greater than B;
Assuming that :
For normal comparison the code would look something like this :
If the code above was executed with the given values, then we would expect that the statement
A and B are not equal
as 10 is not greater or equal to 20.Now to test the reverse or
the negated version of A >= B
we would simply achieve it by adding theNOT symbol (!)
in our expression to reverse it.The expected response buy running the code above is that statement
A and B are not equal
will be returned.