I spent about 3 hours debugging my php code all over a missing “=” !!!
One “=” is a variable assignment, and two “==” is a test condition. Something like…
$var = false; // a boolean variable, assign a value of false
if ($var == true) { do something } ;
But what I was doing instead was …
if ($var = true) { do something } ; // Ie, one “=”
The affect of doing this is the variable $var is being assigned the value of “true”. PHP doesn’t give you an error or a warning even though it actually doesn’t make sense to do an assign value in a conditional test!! So I spent 3 hours in frustration trying to figure out where in my code my variable is mysteriously being changed back to true when it should be false ! Aaargghhh.
End of vent.