The if else / else if condtional statement execute block of code when condition is true and another code execute condiotion false.
Syntax
if (condition){
Code to be executed
}else if (condition){
Code to be executed
}else{
Code to be executed
}
Example
$a=5;
$b=3;
if($a>$b){
echo "a is bigger than b";
}else if($a==$b){
echo "a is equal to b";
}else{
echo "a is smaller than b";
}
Copyright ©2022 coderraj.com. All Rights Reserved.