PHP Conditions

If/Else Example

The score is passing.

Switch/Case Example

It is Monday.

Explanation

Conditions let a PHP program make decisions based on whether something is true or which value is being tested. An if/else statement chooses between two paths. A switch statement compares one value with different case options and runs the matching section. The default section runs when no case matches.

Back to Activity 3