If You ONly Knew
PHP – P24: If Statement
The if statement is probably the first piece of code that you wrote. “If” statements are conditional statements, meaning that if the expression that they’re evaluating is true, the if statement will allow for the execution of the expressions inside of the if statement body.
What else is there?
PHP – P25: else Statement
Else statements execute when the if statement’s condition evaluates to false. Remember, the expressions inside of the if statement can only execute when the conditional expression evaluates to true.
ELSEIF: BETWEEN IF AND ELSE
PHP – P26: ELSEIF STATEMENT
When you have more than 2 outcomes in your decision making, you’re going to need to use the PHP elseif statement. The elseif keyword goes in between the if and the else keywords.