Tutorial 13 – Else If Statements
| In: 13. Else If Statements | 7,067 views
Video Tutorial
Video Source Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | <!--?php //File Description: PHP Else If Statements /* if (temp < 60 degrees) { It is cold outside } elseif (temp >= 60 degrees && temp <= 80 degrees) { It is warm outside } elseif (temp > 80 degrees && temp < 100 degrees) { It is hot outside } else { It is extremely hot outside } */ // Example $temp = 50; // holds the temperature if ($temp < 60) { echo "It is cold outside"; } elseif ($temp >= 60 && temp =< 80) { echo "It is warm outside"; } elseif ($temp > 80 && $temp < 100) { echo "It is hot outside"; } else { echo "It is extremely hot outside"; } ?> |
4 Responses to Tutorial 13 – Else If Statements
Maggie
May 30th, 2014 at 2:33 pm
Alun J
May 30th, 2014 at 2:33 pm
Matthew S
May 30th, 2014 at 2:35 pm
Joe
April 20th, 2015 at 4:41 am