What is the difference between =
and ==
? I have found cases where the double equal sign will allow my script to run while one equal sign produces a
Example:
$test = 1;
if($test=2){
echo "Hello";
}
if($test==2){
echo "world";
}
//The result is Hello because = is assigning the value to $test and the second condition is false because it check the equality of $test to the value 2.
I hope this will help.