Elseif construct:
Combination of else and if is known as elseif or else if. It is executed only when the if portion is false, but unlike else, we can put any condition with it. The conditions will be check only when the if part is false.Example:
<?php
$a
=13;$b
=44;$c
=142;if
($a>$b){
if($a>$c)echo '$a is greatest';}
elseif
($b>$c) echo '$b is greatest';else echo
'$c is greatest';?>
Output:
$c is greatest
Example:
<?php
$a
=1333;$b
=144;$c
=142;if
($a>$b && $a>$c) echo '$a is greatest';elseif
($b>$c && $b>$a) echo '$b is greatest';else echo
'$c is greatest';?>
Output:
$a is greatest
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.