728x90
SMALL
#php
#PHP/operators/comparison operators
A comparison operator is an operator that compares two values.
$a == $b
Returns TRUE if $a equals $b. for example
$a = 123;
$b = 123;
This is TRUE. Also
$a = 123;
$b = '123';
When is also TRUE.
$a === $b
Returns TRUE if $a and $b are the same and have the same data type. for example
$a = 123;
$b = 123;
This is TRUE. but,
$a = 123;
$b = '123';
is FALSE.
$a != $b
Returns TRUE if $a is not equal to $b.
$a <> $b
Returns TRUE if $a is not equal to $b.
$a !== $b
Returns TRUE if $a is not equal to $b or is not of the same data type. for example
$a = 123;
$b = 234;
This is TRUE. Also
$a = 123;
$b = '123';
is also TRUE.
$a < $b
Returns TRUE if $a is less than $b.
$a > $b
Returns TRUE if $a is greater than $b.
$a <= $b
Returns TRUE if $a is less than or equal to $b.
$a >= $b
Returns TRUE if $a is greater than or equal to $b.
728x90
LIST
'PHP' 카테고리의 다른 글
[PHP] PHP/operators/logical operators (0) | 2022.08.14 |
---|---|
[PHP] PHP/operators/increase operator, decrease operator (0) | 2022.08.13 |
[PHP] PHP/operators/arithmetic operators (0) | 2022.08.08 |
[PHP] PHP/operator/assignment operator (0) | 2022.08.04 |
[PHP] How to create PHP/variables/flow variables (variables within variables) (0) | 2022.08.04 |