Question about using if elseif ...
| From: | Fargo Lee | Date: | Thu, 18 Jul 2002 21:28:23 +0000 |
| Subject: | Question about using if elseif ... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108339@lists.php.net to get a copy of this message | ||
When viewing examples of using if and elseif I often see the example ending
with an else like ...
if($a == '1'){
echo '1';
} elseif ($a == '2'){
echo '2';
} else {
echo '0';
}
Is there any problem with leaving out the last else and just ending it with
an elseif such as ...
if($a == '1'){
echo '1';
} elseif ($a == '2'){
echo '2';
}