Re: how to say "inverse your value" (to a boolean)?
| From: | Ralph Deffke | Date: | Mon, 10 Aug 2009 22:50:47 +0000 |
| Subject: | Re: how to say "inverse your value" (to a boolean)? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296579@lists.php.net to get a copy of this message | ||
with XOR
try this
$a = 0;
echo $a ^ 1;
$a = 1;
echo $a ^ 1;
hope that helps
ralph
ralph_deffke@yahoo.de
"John Butler" <govinda.webdnatalk@gmail.com> wrote in message
news:52842D6F-DD45-44A6-AE06-2E58EF8F6D8E@gmail.com...
> quick Q:
> I have this inside a foreach{} that I want to alternate between on
> and off so I can alternate the background-color of my <tr>'s.
>
> $tableRowBGcolorBoolCounter != $tableRowBGcolorBoolCounter; //-boolean
> on and off
>
> I am looking thru' docs and books, but can't remember (nor find now)
> in PHP how to say "inverse your value" (to a boolean).
> ?
>
> TIA! -G
>