I am currently teaching a PHP introductory course to students with some background in HTML, CSS and (very basic/limited) JS. While going over the list of various operators in PHP, I was able to give examples for logical AND and OR in context of processing registration forms:
AND: We want our users to be above a certain age limit AND accept our terms and conditions.
OR: We want new users to pay a registration fee OR refer three other people to register.
While you can frame my OR example as actually being a XOR. I'm looking for a better example, preferably in the context of (registration-like) forms.
Googling it doesn't give much juice. The one example that I somewhat liked is @ http://blogs.msdn.com/b/mvpawardprogram/archive/2013/07/22/excel-2013-real-world-examples-of-new-functions.aspx under "XOR()" (the working half day example).
So, I'm here to ask the community to come up with an example where using XOR in (validating) a registration form would make sense.
And, while we are at it, are there any similar examples for the usage of bitwise operators in general? Where would using bitwise operators make sense, except for compressing many booleans values to save some bytes.
Thanks for any help.