in PHP you may compare 2 values using the == operator or === operator. the difference is this:
PHP is a dynamic, interpreted language that is not strict on data types. it means that the language itself will try to convert data types, whenever needed.
echo 4 + "2"; // output is 6
output is integer value 6. because + is numerical addition operator in PHP, so if you provide it operands with other data types, PHP will first convert them to their appropriate type ( "2" will be converted to 2 ) and then perform the operation.
if you use == as comparison operator with 2 operands that might be in different data types, PHP will convert the second operand type, to the first's. so:
4 == "4" // true
php converts "4" to 4, and then compares the values. in this case the result will be true.
if you use === as comparison operator, PHP will not try to convert any data types. so if the operands' types are different, then they are NOT identical.
4 === "4" // false