Conditional statements are used to perform different actions based on different conditions. Very often when
writing code, you want to perform different actions for different conditions, which is made possible by statements
such as if, else, and switch. They give your program the ability to "make
decisions" on which path to take.
In PHP, we have three main ways to check conditions and direct the flow of the program:
true).else block will run.case statements).To write a condition inside the parentheses of an if statement, we use operators. Here are the ones
you need to know:
== (equal), === (identical - equal value and
type), != (not equal), < (less than), > (greater than).&& (AND – both conditions must be true) and
|| (OR – at least one of the conditions must be true).