At 11:52 AM +0100 12/7/09, Merlin Morgenstern wrote:
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!
The variable "page" cannot hold two values at the same time and thus
your statement "The result should never contain 1 AND 2 in the same
time" is nonsense.
Now if you are working two variables, namely $a and $b and you want
an algorithm to solve your problem, it's simple.
if ($a + $b > 3)
$result = true;
$result = false;
http://sperling.com http://ancientstones.com http://earthstones.com
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php