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 lofical operators in PHP.

Logical Operators in PHP

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 usefull.

This entry was posted in Programming and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>