Liya Zhu - Assignment 3 - Condition

example of an if…else condition

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

example of an if…elself…else condition

Today is Saturday. Only one day left to finish my 440 assignment!

example of a PHP switch/case

Today is the due date of my 440 assignment! Going to submit my assignment!
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