PHP Conditions

If/Else Condition Example

You passed the class.

Switch Case Example

Today is Monday.

Explanation

Conditions allow a PHP program to make decisions based on different situations. An if/else statement checks whether a condition is true and chooses which code should run. A switch statement compares one value against several possible cases and runs the code that matches that value.

Back to Activity 3