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 |
If you listen carefully, you can hear the 1s and 0s flowing in your computer.
When would you use a &&
versus the and
? How about the ||
versus the or
?
Know 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.