In PHP, as I write: NOT SMALL THAN

For example: a not less than b

How to write it down?

+3
source share
6 answers
if ($a >= $b) 

if !($a < $b)
+11
source

Having an exclamation mark outside the condition causes a syntax error, right?

if(!($a < $b))

"IF NOT SMALL THAN B"

Makes the most linguistic sense compared to their question.

+5
source

If a is not less than b, then a is greater than or equal to b like this:

$a >= $b
+4
source
!($a<$b)

Or simply

$a>=$b
+4
source

a> = b

Assuming a and b are guaranteed to be comparable.

+2
source
if( $a >= $b ) {
    echo $a . " is not smaller than " . $b;
} else {
    echo $a . " is smaller than " . $b;
}
+1
source

Source: https://habr.com/ru/post/1757040/


All Articles