== or =


#1

I am trying to understand why I would use == as apposed to =. I wrote an if else statement as follows:
<?php
// Write your if/elseif/else statement here!
$wall = "blue";
if ($wall = "white") {
echo "Boring";
}
else {
echo "That is interesting.";
}
?>

The output showed "boring", but when I changed the if statement to have == it showed "That is interesting." Why would an = not be sufficient?


#2

The above is an assignment where we need to write a comparison:

if ($wall == "white") {

The above condition tests for equality.