mosi Posted July 11, 2007 Share Posted July 11, 2007 Just a quick question. If I have an if statement which goes "if ((a == b) && (c==d) && (e==f))" if a != b does it still check the other two parts to the statement or not? I know it won't really make much difference if any to load times but I was just curious. Quote Link to comment Share on other sites More sharing options...
pedrobcabral Posted July 11, 2007 Share Posted July 11, 2007 http://pt2.php.net/manual/en/language.operators.logical.php Take a look at the first table. Pretty explanatory. Quote Link to comment Share on other sites More sharing options...
Caesar Posted July 11, 2007 Share Posted July 11, 2007 Yes it does. All the statements would need to prove true in that case. Only time it wouldn't, would be if your conditional statemt looked like.... <?php if(($a == $b) || ($a == $c) || ($a== $d)) { //DO THIS HERE } ?> Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 11, 2007 Share Posted July 11, 2007 if (a == b && c==d && e==f) that is proper if you have the && it should true all the statement if one is false then all is like false meaning the condition is not satisfy but if (a == b || c==d || e==f) if one of the statement here is write its like everything is right hope that helps 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.