0

can anyone tell me how to use else if and if else

12th Sep 2016, 4:07 PM
Audrey Gyasi
Audrey Gyasi - avatar
5 Réponses
0
Suppose .... <?php $a = 20; $b = 10; $c =30; if(a>b && a>c){ echo "A is greater"; } else if(a<b && b>c) { echo "B is greater"; } else { echo "C is greater"; } ?>
12th Sep 2016, 4:14 PM
Waqar Ali
Waqar Ali - avatar
0
resha
12th Sep 2016, 4:16 PM
Resha Shahijan
Resha Shahijan - avatar
0
tnk u
12th Sep 2016, 4:40 PM
Audrey Gyasi
Audrey Gyasi - avatar
0
the syntax would be if ( conditon) { if the condition is true -execute code; } else if (other condition) { if the conditon is true. execute; } else // if the condition is false it goes to else code { false - execute code; }
13th Sep 2016, 3:15 AM
Nark Bocateja Duyac
Nark Bocateja Duyac - avatar
0
r.k.shahijan.917@gmail.cim
13th Sep 2016, 6:12 AM
Resha Shahijan
Resha Shahijan - avatar