Jump to content

ELSEIF


AV1611

Recommended Posts

yes, because elseif implies that the if was FALSE. else implies that the if (or elseif) was FALSE.

if (if this is true) {
do this
} elseif (since the above was not true, check if this is true. if it is true) {
do this
} else {
since the above was not true, do this
}

the difference between elseif and else is that else will be executed no matter what, if the if is false, whereas the elseif will only be executed if the if is false and the elseif is true. but elseif and/or else will not be executed if the if is true.
Link to comment
https://forums.phpfreaks.com/topic/11508-elseif/#findComment-43340
Share on other sites

[!--quoteo(post=381549:date=Jun 8 2006, 08:09 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Jun 8 2006, 08:09 PM) [snapback]381549[/snapback][/div][div class=\'quotemain\'][!--quotec--]
the difference between elseif and else is that else will be executed no matter what, if the if is false, whereas the elseif will only be executed if the if is false and the elseif is true. but elseif and/or else will not be executed if the if is true.
[/quote]

I think I preferred Poirot's answer :-)
Link to comment
https://forums.phpfreaks.com/topic/11508-elseif/#findComment-43365
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.