The What
The logical operators compare the values of two pieces of data from an expression. You use the operators to build the conditional expressions you need to control the flow of your code.
Developing & Empowering WordPress Developers
The logical operators compare the values of two pieces of data from an expression. You use the operators to build the conditional expressions you need to control the flow of your code.
AND | Right false |
Right true |
---|---|---|
Left false |
false | false |
Left true |
false | true |
OR | Right false |
Right true |
---|---|---|
Left false |
false | true |
Left true |
true | true |
XOR | Right false |
Right true |
---|---|---|
Left false |
false | true |
Left true |
true | false |
Don’t repeat yourself. Don’t repeat yourself. Don’t repeat yourself.
When would you use a &&
versus the and
? How about the ||
versus the or
?
Know the Code develops and empowers professional WordPress developers, like you. We help you to grow, innovate, and prosper.
Join NowKnow the Code flies on WP Engine. Check out the managed hosting solutions from WP Engine.
WordPress® and its related trademarks are registered trademarks of the WordPress Foundation. The Genesis framework and its related trademarks are registered trademarks of StudioPress.
This website is not affiliated with or sponsored by Automattic, Inc., the WordPress Foundation, or the WordPress® Open Source Project.