BrianM Posted April 23, 2008 Share Posted April 23, 2008 Can this be done, multiple elseif statements. Something along these lines... <?php if ... else ... elseif ... elseif ... elseif ... elseif ... elseif ... elseif ... Link to comment https://forums.phpfreaks.com/topic/102620-multiple-elseif-statements/ Share on other sites More sharing options...
MasterACE14 Posted April 23, 2008 Share Posted April 23, 2008 <?php if ... elseif ... elseif ... elseif ... elseif ... elseif ... elseif ... else ... the else always has to go last. I think, don't quote me on that. note you could just use the switch statement instead Regards ACE Link to comment https://forums.phpfreaks.com/topic/102620-multiple-elseif-statements/#findComment-525542 Share on other sites More sharing options...
BrianM Posted April 23, 2008 Author Share Posted April 23, 2008 Heh, can somebody confirm this, please? Link to comment https://forums.phpfreaks.com/topic/102620-multiple-elseif-statements/#findComment-525543 Share on other sites More sharing options...
allistera Posted April 23, 2008 Share Posted April 23, 2008 if (Condition) { //code } elseif (Condition) { //code } elseif (Condition) { //code } else { //code } Link to comment https://forums.phpfreaks.com/topic/102620-multiple-elseif-statements/#findComment-525545 Share on other sites More sharing options...
BrianM Posted April 23, 2008 Author Share Posted April 23, 2008 Alright, thank you very much! =] Link to comment https://forums.phpfreaks.com/topic/102620-multiple-elseif-statements/#findComment-525548 Share on other sites More sharing options...
BrianM Posted April 23, 2008 Author Share Posted April 23, 2008 Actually one more thing, does the last statement have to be an else or can it also be elseif? Link to comment https://forums.phpfreaks.com/topic/102620-multiple-elseif-statements/#findComment-525550 Share on other sites More sharing options...
allistera Posted April 23, 2008 Share Posted April 23, 2008 It doesn't need to be a else, it can be elseif or else if Link to comment https://forums.phpfreaks.com/topic/102620-multiple-elseif-statements/#findComment-525573 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.