I would strongly recommend doing some quick experiments to see how this works in any particular circumstance.
In particular check this out:
$i = 1;
var_dump($i == 9999);
var_dump($i = 9999);
The first var_dump statement outputs false because the value assigned to $i is 1, not 9999. The second var_dump statement outputs the integer 9999 because you are assigning this value to $i because there is only one equal sign. The vast majority of the time, you want to use at least two equal signs with your if statement because you are asking if the two values are equal and you are not making a value assignment. There are a few exceptions.
This is also worth noting:
$i = 1;
var_dump($i == "1");
var_dump($i === "1");
The first var_dump returns TRUE because PHP performs an implicit cast of the values for the sake of comparison. The second one is false because $i is an integer value but "1" is a string value. As Nogdog said, when you use 3 equal signs (===), you are testing both the values and their native type. This is called 'strict equality.'