<? #1 = ON $interstitial_status = 0; if ($interstitial_status = 1) { echo "Interstitials are currently: On"; }else{ echo "Interstitials are currently: Off"; } ?>
How come this doesnt work? I have the variable set to 0 and it keeps saying its on when I run the page?
ahhhh I figured out what it was. I need two == signs. Why is that? How do I know when to put 1 = sign or 2?
A single = is used for assigning a value to a variable.
Double == is used for testing equality of two values.
So use = whenever you want to assign a value to a variable and use == whenever you are testing the value of a variable in an expression.
thanks