代码之家  ›  专栏  ›  技术社区  ›  Sam Johannes Rudolph

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

  •  15
  • Sam Johannes Rudolph  · 技术社区  · 14 年前

    它是 >!= ?

    12 回复  |  直到 6 年前
        1
  •  159
  •   Svish    14 年前

    不是吗 not greater than or equal to x 一样 less than x

        2
  •  118
  •   Rab    14 年前

    哦,有趣。按复杂性的递增顺序:

    1. <
    2. (a-b>0)
    3. !(a>=(二)
    4. !((a>b) | |(a==b))
    5. !(a-b<0)和&(a-b==0)
    6. !((a-b<0)| |(a-b==0))&&!((<b) ()

    就我个人而言,我会为那些真正让我恼火的人预留8英镑

        3
  •  16
  •   Lizard    14 年前

    写这个最好的方法是

    $x = 4;
    $y = 6;
    
    if($x < $y) echo "True";
    
    // True
    
    $x = 4;
    $y = 6;
    
    if(!($x >= $y)) echo "True";
    
    // True
    
        4
  •  11
  •   Neil Williams    14 年前

    < .

    !(a >= b) .

        5
  •  6
  •   murgatroid99 dhg    14 年前
    <
    

    (小于等于不大于或等于)

        6
  •  5
  •   John Rasch    14 年前

    从技术上讲,你问了两个不同的问题——如何写作 A not greater than B or A equal to B A not equal to B or A greater than B .

    声明 A不大于B或A等于B

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

    A <= B
    

    以及 A不等于B或A大于B

    A != B || A > B
    

    A >= B
    

    其他答案 A < B A not greater than nor A equal to B .

        7
  •  4
  •   Trefex    14 年前

    < ?

        8
  •  4
  •   ninjalj    14 年前

    为了证明那些不相信小于等于等于等于等于等于等于小于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于等于

    <?
    $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";
    }
    ?>
    

    $ php5 nan.php 
    NAN
    1
    ge
    lt
    
        9
  •  1
  •   Alonso Dominguez    11 年前

    a b 相当于 b < a

        10
  •  0
  •   Fabiano    14 年前

    http://www.php.net/manual/en/language.operators.logical.php

    它展示了有关运算符的有趣的事情以及如何使用它们。。。我突出显示了这个特定的逻辑运算符页面,因为当您使用它们的相似项时,它们的行为尤其不同,比如“| |”和“or”。

    值得一看()

        11
  •  0
  •   m0g    14 年前

    !&燃气轮机;或<&燃气轮机;

        12
  •  0
  •   Alin Razvan    7 年前

    <?php 
    
    #not lower than 5 AND not greater than 12 
    
    if(!($nr<5)&&!($nr>12)){ }
    
    ?>