Home >Backend Development >PHP Problem >What is the inequality operator in php
There are three types of inequality operators in PHP, namely: 1. != symbol, used to compare the values of two variables; 2. symbol, indicating inequality, and != symbol usage Same; 3. !== symbol, which means absolutely not equal. If the two variable values are different or their types are not the same, then true is returned.
#The operating environment of this article: Windows7 system, PHP7.1, Dell G3 computer.
What is the inequality operator in php?
The inequality operators in php are !=
, ,
!==
.
You can take a look at the example:
x != y: Not equal, if x is not equal to y, return true 5!=8 Return true;
x y: Not equal, if x is not equal to y, return true 58 Return true;
x !== y: Absolutely not equal, if x is not equal to y, or their types are not If they are the same, return true 5!=="5" Return true .
Recommended study: "PHP Video Tutorial"
The above is the detailed content of What is the inequality operator in php. For more information, please follow other related articles on the PHP Chinese website!