Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In PHP how do i write: IS NOT SMALLER THAN

Tags:

php

For example: a is not smaller than b

How do i write this ?

like image 277
Jenphp Avatar asked Jul 28 '10 21:07

Jenphp


4 Answers

if ($a >= $b) 

if !($a < $b)
like image 182
Josh Smeaton Avatar answered Oct 18 '22 23:10

Josh Smeaton


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.

like image 40
user400850 Avatar answered Oct 19 '22 00:10

user400850


If a is not smaller than b, a is either greater than or equal to b so:

$a >= $b
like image 43
ternaryOperator Avatar answered Oct 19 '22 00:10

ternaryOperator


!($a<$b)

Or simply

$a>=$b
like image 44
Klaus Avatar answered Oct 18 '22 23:10

Klaus