Kunal P. answered 05/12/19
Experienced Web Developer teaching programming languages.
Equality operator in php i.e == compares value of operands while identity operator i.e, === compares value as well as data type of operands.
For example,
1)
if(120 == "120")
echo "equal";
else
echo "not equal";
Here, output will be 'equal'. Because both operands have value 120 but data types are different first is integer and second is string "120" it will ignore this.
2)
if(120 === "120")
echo "identical";
else
echo "not identical";
Here, output will be 'not identical'. Because both operands have different data types even when they have same values.