>!= PHP运算符,如何写不等于或大于?

时间:2022-09-18 13:09:34

How can I write not greater-than-or-equal-to in PHP?

如何在PHP中编写不大于或等于?

Is it >!= ?

是>!=?

12 个解决方案

#1


139  

Isn't not greater than or equal to x the same as less than x ?

是不是大于或等于x小于x?

#2


110  

Oh, fun. In increasing order of complexity:

有趣哦。按复杂程度递增:

  1. <
  2. (a - b > 0)
  3. (a - b> 0)

  4. !(a >= b)
  5. !(a> = b)

  6. !(a - b <= 0)
  7. !(a - b <= 0)

  8. !((a > b) || (a==b))
  9. !((a> b)||(a == b))

  10. !(a - b < 0) && !(a - b == 0)
  11. !(a - b <0)&&!(a - b == 0)

  12. !((a - b < 0) || (a - b == 0)) && !(!(a < b))
  13. !((a - b <0)||(a - b == 0))&&!(!(a ))

  14. !(a - b < ((a * (1/a)-1) * (b * (1/b)-1))) && !(a - b == (a * (1/a)-1) * (b * (1/b)-1)))
  15. !(a - b <((a *(1 / a)-1)*(b *(1 / b)-1)))&&!(a - b ==(a *(1 / a)-1) )*(b *(1 / b)-1)))

Personally, I would reserve #8 for someone who really annoyed me. ;)

就个人而言,我会为那些真烦我的人保留#8。 ;)

#3


14  

The best way to write this is

写这个的最好方法是

$x = 4;
$y = 6;

if($x < $y) echo "True";

// True

$x = 4;
$y = 6;

if(!($x >= $y)) echo "True";

// True

#4


10  

"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).

如果你真的想说“不大于或等于”,你可以写一下!(a> = b)。

#5


5  

<

(less than is the same as not greater than or equal to)

(小于或等于不大于)

#6


5  

Technically, you have asked two different questions - how to write A not greater than B or A equal to B and A not equal to B or A greater than B.

从技术上讲,你提出了两个不同的问题 - 如何写A不大于B或A等于B和A不等于B或A大于B.

The statement A not greater than B or A equal to B implies:

声明A不大于B或A等于B意味着:

!(A > B) || A == B

which is a tautology for:

这是一个重言式:

A <= B

And A not equal to B or A greater than B implies:

A不等于B或A大于B意味着:

A != B || A > B

which is a tautology for:

这是一个重言式:

A >= B

The other answers of A < B are representative of the statement A not greater than nor A equal to B.

A 的其他答案代表a语句不大于a和a等于b.

#7


4  

simply use < ?

只需使用

#8


4  

To prove the disbelievers that less than is different than not greater or equal:

要证明那些不同于不大于或等于的不信道者:

<?
$i = acos(4);
print $i."\n";
print is_nan($i)."\n";
if (4>=$i) {
    print "ge\n";
} else {
    print "nge\n";
}
if (4<$i) {
    print "lt\n";
} else {
    print "nlt\n";
}
?>

It outputs this on my system:

它在我的系统上输出:

$ php5 nan.php 
NAN
1
ge
lt

#9


1  

a not greater or equal to b is equivalent to b < a

a不大于或等于b等于b

#10


0  

Take a look at this page: http://www.php.net/manual/en/language.operators.logical.php

看看这个页面: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 =)

值得一看=)

#11


0  

Doing it the way you word it

按照你说的方式去做

!> or <>

!>或<>

#12


0  

Some simple example :

一些简单的例子:

<?php 

#not lower than 5 AND not greater than 12 

if(!($nr<5)&&!($nr>12)){ }

?>

#1


139  

Isn't not greater than or equal to x the same as less than x ?

是不是大于或等于x小于x?

#2


110  

Oh, fun. In increasing order of complexity:

有趣哦。按复杂程度递增:

  1. <
  2. (a - b > 0)
  3. (a - b> 0)

  4. !(a >= b)
  5. !(a> = b)

  6. !(a - b <= 0)
  7. !(a - b <= 0)

  8. !((a > b) || (a==b))
  9. !((a> b)||(a == b))

  10. !(a - b < 0) && !(a - b == 0)
  11. !(a - b <0)&&!(a - b == 0)

  12. !((a - b < 0) || (a - b == 0)) && !(!(a < b))
  13. !((a - b <0)||(a - b == 0))&&!(!(a ))

  14. !(a - b < ((a * (1/a)-1) * (b * (1/b)-1))) && !(a - b == (a * (1/a)-1) * (b * (1/b)-1)))
  15. !(a - b <((a *(1 / a)-1)*(b *(1 / b)-1)))&&!(a - b ==(a *(1 / a)-1) )*(b *(1 / b)-1)))

Personally, I would reserve #8 for someone who really annoyed me. ;)

就个人而言,我会为那些真烦我的人保留#8。 ;)

#3


14  

The best way to write this is

写这个的最好方法是

$x = 4;
$y = 6;

if($x < $y) echo "True";

// True

$x = 4;
$y = 6;

if(!($x >= $y)) echo "True";

// True

#4


10  

"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).

如果你真的想说“不大于或等于”,你可以写一下!(a> = b)。

#5


5  

<

(less than is the same as not greater than or equal to)

(小于或等于不大于)

#6


5  

Technically, you have asked two different questions - how to write A not greater than B or A equal to B and A not equal to B or A greater than B.

从技术上讲,你提出了两个不同的问题 - 如何写A不大于B或A等于B和A不等于B或A大于B.

The statement A not greater than B or A equal to B implies:

声明A不大于B或A等于B意味着:

!(A > B) || A == B

which is a tautology for:

这是一个重言式:

A <= B

And A not equal to B or A greater than B implies:

A不等于B或A大于B意味着:

A != B || A > B

which is a tautology for:

这是一个重言式:

A >= B

The other answers of A < B are representative of the statement A not greater than nor A equal to B.

A 的其他答案代表a语句不大于a和a等于b.

#7


4  

simply use < ?

只需使用

#8


4  

To prove the disbelievers that less than is different than not greater or equal:

要证明那些不同于不大于或等于的不信道者:

<?
$i = acos(4);
print $i."\n";
print is_nan($i)."\n";
if (4>=$i) {
    print "ge\n";
} else {
    print "nge\n";
}
if (4<$i) {
    print "lt\n";
} else {
    print "nlt\n";
}
?>

It outputs this on my system:

它在我的系统上输出:

$ php5 nan.php 
NAN
1
ge
lt

#9


1  

a not greater or equal to b is equivalent to b < a

a不大于或等于b等于b

#10


0  

Take a look at this page: http://www.php.net/manual/en/language.operators.logical.php

看看这个页面: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 =)

值得一看=)

#11


0  

Doing it the way you word it

按照你说的方式去做

!> or <>

!>或<>

#12


0  

Some simple example :

一些简单的例子:

<?php 

#not lower than 5 AND not greater than 12 

if(!($nr<5)&&!($nr>12)){ }

?>