Conditions in PHP

1. If/Else Example

You are 22 years old. You are allowed to vote.

2. Switch (Case) Example

Today is Monday. It is the start of the week.

Explanation

Conditions in PHP are used to make decisions in a program. They allow the code to run different actions depending on whether something is true or false. The if/else statement checks one condition, while the switch statement checks multiple possible values.