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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
182x Posted July 18, 2007 Author Share Posted July 18, 2007 Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.