=
, ==
, ===
?
I think using one equal sign is to declare a variable, two equal signs are used to compare conditions, and the last three equal signs are used to compare the value of the declared variable.
P粉5459565972024-03-20 10:07:34
=
is the assignment operator===
is the same comparison
operator (checks whether two variables
have the same value and are the same
type). P粉8999507202024-03-20 00:40:22
You have =
assignment operator , ==
"equals" comparison operator and ===
"Same" comparison operator.
$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)
For more information on the necessity of ==
and ===
and their respective usage, see Documentation.