For example: a is not smalle开发者_运维知识库r than b
How do i write this ?
if ($a >= $b)
if !($a < $b)
Having an exclamation point outside of the condition causes a syntax error, doesn't it?
if(!($a < $b))
"IF NOT A SMALLER THAN B"
Makes the most linguistic sense compared to their question.
If a is not smaller than b, a is either greater than or equal to b so:
$a >= $b
!($a<$b)
Or simply
$a>=$b
a >= b
Assuming that a and b are guaranteed to be comparable.
if( $a >= $b ) {
echo $a . " is not smaller than " . $b;
} else {
echo $a . " is smaller than " . $b;
}
精彩评论