$a = $b Assign Sets $a to be equal to $b.
$a == $b Equal TRUE if $a is equal to $b.
$a === $b Identical TRUE if $a is equal to $b, and they are of the same type. (introduced in PHP 4)
$a = 2;
$b = 2;
if ($a == $b) {
echo both variables have the same value;
}
= = = 类似于 = = 的运算符(检查值是否相等) ,并检查两个数据类型是否相同
$a = 2;
$b = "2";
if ($a === $b) {
echo "both variable have same value and of same data type";
} else {
echo 'both variable is either not equal or not of same data type';
}