182x Posted July 18, 2007 Share Posted July 18, 2007 Hey guys in the following code structure would the ELSE only apply to the second IF statement or is there any change it could be affected by the first IF? Structure IF ... IF ... ELSE .... IF Link to comment https://forums.phpfreaks.com/topic/60646-solved-newbie-logic-question/ Share on other sites More sharing options...
GingerRobot Posted July 18, 2007 Share Posted July 18, 2007 I guess you meant any chance. It depends on how you nest your statements. Consider two examples: <?php if($somecondition == true){ if($othercondition == true){ //$somecondition is true and othercondition is true }else{ //$somecondition is true and othercondition is false } } ?> <?php if($somecondition == true){ if($othercondition == true){ //$somecondition is true and othercondition is true } }else{ //$somecondition is false and othercondition is either true or false } ?> I dont think i can explain it better in words than by example, so i wont as ill just confuse the issue. Hopefully you understand. Link to comment https://forums.phpfreaks.com/topic/60646-solved-newbie-logic-question/#findComment-301741 Share on other sites More sharing options...
182x Posted July 18, 2007 Author Share Posted July 18, 2007 Thanks Link to comment https://forums.phpfreaks.com/topic/60646-solved-newbie-logic-question/#findComment-301755 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.