Liya Zhu - Assignment 3 - Condition

example of an if…else condition

Today is Thursday. Still have a few days to finish my 440 assignment!

example of an if…elself…else condition

Today is Thursday. Still have a few days left to submit my assignment!

example of a PHP switch/case

Buy some food.
Now I'm done.

Explain

Conditional statements are used to perform different actions based on different conditions.

In PHP, we have the following conditional statements:

Statement Description
if Executes some code if one condition is true
if ... else Executes some code if a condition is true and another code if that condition is false
if ... elseif ... else Executes different code for more than two conditions
switch Selects one of many blocks of code to be executed