Home >Backend Development >PHP Tutorial >Introduction to the differences between =, == and === in php
===Compares the values and types of two variables; ==Compares the values of two variables, but does not compare data types.
For example:
$a = '123'; $b = 123; $a === $b; //为假 $a == $b; //为真
= means assignment.
For example:
$a=2; $a=$q;
At this time, whether you echo $a or echo $q, it will output 2.
For more related tutorials, please pay attention to php中文网.
The above is the detailed content of Introduction to the differences between =, == and === in php. For more information, please follow other related articles on the PHP Chinese website!