MasterACE14 Posted May 21, 2007 Share Posted May 21, 2007 ok, i'm a PHP n00b, but i'm wondering how this script, equals 28 ??? <?php if (10 == 10) { print 1 + 1; } else { print 2 + 2; } if (10 == 11) { print 3 + 3; } else { print 4 + 4; } ?> Link to comment https://forums.phpfreaks.com/topic/52310-solved-php-n00b-if-else-statement-help-needed/ Share on other sites More sharing options...
jitesh Posted May 21, 2007 Share Posted May 21, 2007 Run following code. <?php echo "Run First If Condition<br>"; if (10 == 10) { print 1 + 1; echo "<br>"; } else { print 2 + 2; echo "<br>"; } echo "Run Second If Condition<br>"; if (10 == 11) { print 3 + 3; echo "<br>"; } else { print 4 + 4; echo "<br>"; } ?> Link to comment https://forums.phpfreaks.com/topic/52310-solved-php-n00b-if-else-statement-help-needed/#findComment-258043 Share on other sites More sharing options...
MasterACE14 Posted May 21, 2007 Author Share Posted May 21, 2007 lol, I see my simple mistake lol, How could I miss that (Sorry about double post, my PC hiccupped :-\ ) Link to comment https://forums.phpfreaks.com/topic/52310-solved-php-n00b-if-else-statement-help-needed/#findComment-258048 Share on other sites More sharing options...
MasterACE14 Posted May 21, 2007 Author Share Posted May 21, 2007 lol, I see my simple mistake now, can't believe I missed it! lol Thanks for the help , I don't think Im ever going to make a mistake like that again lol Link to comment https://forums.phpfreaks.com/topic/52310-solved-php-n00b-if-else-statement-help-needed/#findComment-258050 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.