开发者

In PHP how do i write: IS NOT SMALLER THAN

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;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜