Return to Assignment 3 homepage
I have a kiwi!
I have a kiwi!
I have a kiwi!

Conditions work hand in hand with operators and allow for the use of logic in PHP. We can use them to perform different actions based on different conditions. For example, in an if..else statement, we execute some code if a condition is true, and another code if that condition is false. If we add an elseif, it'll execute the code where the first condition is true. A switch statement is similar, as it selects one of many blocks of code to be executed if the conditon is true.