What is the difference between => and >=? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the difference between => and >=?

read the above

5th Mar 2017, 1:20 AM
Nicholas Begg
Nicholas Begg - avatar
2 Answers
+ 10
$a = 5; $b = 4; if ($a >= $b){ echo '$a is GREATER THAN OR EQUAL TO $b'; }else { echo '$a is LESS THAN $b'; } In this case $a is greater than $b. This >= means GREATER OR EQUAL TO, and the opposite means <= LESS THAN OR EQUAL TO. You've got to pay attention to the operands being compared. In my example it checks to see if $a is greater or equal to the operand $b on the right, and it is so it will be true echoing: $a is GREATER THAN OR EQUAL TO $b
5th Mar 2017, 1:53 AM
Mark Foxx
Mark Foxx - avatar
+ 4
=> is used for associative arrays, >= is used for comparison
5th Mar 2017, 2:48 AM
Boris Sundic
Boris Sundic - avatar