View Full Version : else if quick question

12-03-2010, 08:25 PM
Is it ok to use an if/elseif without the last else?

I have some code that I only want to do something based on 2 things and then I don't want it to do anything but move on.

for example


if ($r_status == 0){
echo "this stuff"; }
else if ($r_status == 1){
ehco "this other stuff"; }


$r_status can = 2 & 3 a well but I don't want anything to print, just want it to move on

I have it up and working, just wondering if this is an appropriate way of doing it. Can't find anything online about not using the last else

12-03-2010, 08:34 PM
Yes, that's fine.