mayfair Posted August 7, 2009 Share Posted August 7, 2009 Hi Guys Its late on friday afternoon and im being really stupid. I can't remember if logical operators work both ways? For example if I write the following statement: if ($var1 == $var2) { blah blah blah } Will it also check to see if $var2 is the same as $var1 or would I need to write another statement: if ($var2 == $var1) { blah blah blah } Whatever the answer is, im going to beat myself up after this one Quote Link to comment https://forums.phpfreaks.com/topic/169235-solved-simple-operator-question/ Share on other sites More sharing options...
mikesta707 Posted August 7, 2009 Share Posted August 7, 2009 well if var1 is equal to var2 logic would dictate that var2 is equal to var1. thats like asking if 1 is equal to 1, is 1 equal to 1 Quote Link to comment https://forums.phpfreaks.com/topic/169235-solved-simple-operator-question/#findComment-892998 Share on other sites More sharing options...
mayfair Posted August 7, 2009 Author Share Posted August 7, 2009 Yeah that's what logic did say. Then pessimism set in and I started thinking too hard and wondering if I had to explicitly ask it to compare both ways. Thanks for the reply Quote Link to comment https://forums.phpfreaks.com/topic/169235-solved-simple-operator-question/#findComment-893007 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.