Re: logic operands problem
| From: | Devendra Jadhav | Date: | Mon, 07 Dec 2009 10:56:58 +0000 |
| Subject: | Re: logic operands problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-300265@lists.php.net to get a copy of this message | ||
what do you think about this?
if( ! (page == 1 && page == 2)){
//here
}
On Mon, Dec 7, 2009 at 4:22 PM, Merlin Morgenstern <merlin_x@fastmail.fm>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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Devendra Jadhav
देवेंद्र जाधव