In PHP and any other programming, a big problem is divided into different parts. Each part has it's own condition. Once a condition is fulfilled the statements or line of codes behind the logic executed.
This conditional logic formation is called conditional blocks. Technically this block is created using keywords if, else if, and else.
When a problem has two probable solutions then it has two conditional blocks and this can be created using if and else.
When a problem has more than two probable solutions then it is created by if, else if, and else.
Here are examples.
In this example, 5 is always more than 3 and hence the if statement becomes true and will be executed.
if 5 is greater than 3
echo "5 is greater than 3";
else
echo "5 is less than 3";
In this example, $b is greater than $a, and hence the else statement will be executed.
$a = 6;
$b = 10;
if $a is greater than $b
echo "$a is bigger";
else if $a is equal to $b
echo "$a and $b are equal";
else
echo "$b is bigger";