Re: [PHP] Question about using if elseif ...

2002-07-18 Thread Analysis & Solutions
On Thu, Jul 18, 2002 at 02:28:23PM -0700, Fargo Lee wrote: > 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'; > } On a side note, switch would be more effi

[PHP] Question about using if elseif ...

2002-07-18 Thread Fargo Lee
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 '