Logical Operators in PHP

Just a very quick post. Most of us use the operators && (AND) and || (OR) but 1 that I always forget is XOR. I have knocked up a quick image showing the results when comparing the logical operators in PHP.


As you can see XOR returns true if only 1 of A or B is true. This is not as commonly used as && or || but still useful.

Tell us your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.