Immortal55 Posted March 17, 2006 Share Posted March 17, 2006 Is it possible to place an IF statement in an IF statement? Quote Link to comment Share on other sites More sharing options...
Steveo31 Posted March 17, 2006 Share Posted March 17, 2006 Like...[code]if(..){ if(...){ }}[/code]Yea sure. Quote Link to comment Share on other sites More sharing options...
redarrow Posted March 17, 2006 Share Posted March 17, 2006 [!--quoteo(post=355758:date=Mar 17 2006, 12:58 AM:name=Immortal55)--][div class=\'quotetop\']QUOTE(Immortal55 @ Mar 17 2006, 12:58 AM) [snapback]355758[/snapback][/div][div class=\'quotemain\'][!--quotec--]Is it possible to place an IF statement in an IF statement?[/quote]yes called nesting[code]<?php do { if( ! $condition_1 ) break; // something if( ! $condition_2 ) break; // etc } while ( FALSE );?> [/code] Quote Link to comment Share on other sites More sharing options...
Steveo31 Posted March 17, 2006 Share Posted March 17, 2006 Personally I think case/switches are easier than do/while. 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.