Merlin Morgenstern wrote:
> Hello everybody,
> 
> I am having trouble finding a logic for following problem:
> 
> Should be true if:
> page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3
> 
> The result should never contain 1 AND 2 in the same time.
> 
> This obviously does not work:
> (page = 1 OR page = 3) OR (page = 2 OR page = 3)
> 
> This also does not work:
> (page = 1 OR page = 3 AND page != 2) OR (page = 2 OR page = 3 AND page
> != 1)
> 
> Has somebody an idea how to solve this?
> 
> Thank you in advance for any help!
> 
> Merlin


Surely what you need is xor (exclusive-or)
I can't believe a programmer has never heard of that!

(page==1 XOR page==2) AND page==3

-- 
Peter Ford                              phone: 01580 893333
Developer                               fax:   01580 893399
Justcroft International Ltd., Staplehurst, Kent

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to