Comparison Operators

A PHP Scrapbook while learning PHP
Post Reply
Boardtalk
Site Admin
Posts: 21
Joined: Wed Feb 21, 2018 9:46 pm
Give a date?: 18 Jun 2003

Comparison Operators

Post by Boardtalk »

Operator. Example $x = 4
== Equivalence. Left is equivalent to right e.g. $x == 5 False
!= Non-equivalence. Left is not equivalent to right e.g. $x != 5 True
=== Identical. Left is equivalent to right an they are the same type e.g $x === 4 True
Non-equivalence. Left is equivalent to right but they are not the same type e.g $x === “4” False
> Greater than. Left is great than right e.g. $x > 4 False
>= Left is greater than or equal to right e.g. $x >= 4 True
< Less than. Left is less than right e.g. $x < 4 False
<= Less than or equal to. Left is less than or equal to right e.g. $x <= 4 True

Post Reply