Immortal55 Posted March 17, 2006 Share Posted March 17, 2006 Is it possible to place an IF statement in an IF statement? Link to comment https://forums.phpfreaks.com/topic/5127-if-statements/ Share on other sites More sharing options...
Steveo31 Posted March 17, 2006 Share Posted March 17, 2006 Like...[code]if(..){ if(...){ }}[/code]Yea sure. Link to comment https://forums.phpfreaks.com/topic/5127-if-statements/#findComment-18193 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] Link to comment https://forums.phpfreaks.com/topic/5127-if-statements/#findComment-18194 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. Link to comment https://forums.phpfreaks.com/topic/5127-if-statements/#findComment-18196 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.