-Original Message-
From: Ralph Deffke [mailto:ralph_def...@yahoo.de]
Sent: 11 August 2009 01:45
u...
try
echo pre;
for( $i=0 ; $i10; $i++){
echo something . (($a = $a^1) ? red\n : green\n);
}
The ^ operator is one that has an assigning version, so the above can be
Try $tableRowBGcolorBoolCounter = !$tableRowBGcolorBoolCounter
Notice that it says '= !' instead of !='.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
John Butler govinda.webdnat...@gmail.com wrote in message
news:52842d6f-dd45-44a6-ae06-2e58ef8f6...@gmail.com...
quick Q:
with XOR
try this
$a = 0;
echo $a ^ 1;
$a = 1;
echo $a ^ 1;
hope that helps
ralph
ralph_def...@yahoo.de
John Butler govinda.webdnat...@gmail.com wrote in message
news:52842d6f-dd45-44a6-ae06-2e58ef8f6...@gmail.com...
quick Q:
I have this inside a foreach{} that I want to alternate between
u...
try
echo pre;
for( $i=0 ; $i10; $i++){
echo something . (($a = $a^1) ? red\n : green\n);
}
echo /pre;
watchout the brackets !
cheers
ralph_def...@yahoo.de
John Butler govinda.webdnat...@gmail.com wrote in message
news:52842d6f-dd45-44a6-ae06-2e58ef8f6...@gmail.com...
quick Q:
I
echo something . (($a = $a^1) ? red\n : green\n);
Re: The ? char in this line above..
where in the php docs can I read about what that is doing?
I have not come across this construct before today, from you guys.
thanks
-John
--
PHP General Mailing List (http://www.php.net/)
To
http://us3.php.net/manual/en/language.operators.comparison.php
Find Ternary on that page.
It's a shortened conditional:
cond ? true : false
Adam.
On Mon, Aug 10, 2009 at 6:27 PM, John
Butlergovinda.webdnat...@gmail.com wrote:
echo something . (($a = $a^1) ? red\n : green\n);
Re: The ?
://www.youtube.com/watch?v=qItugh-fFgg)
-Original Message-
From: Adam Randall [mailto:randa...@gmail.com]
Sent: Monday, August 10, 2009 6:41 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Re: how to say inverse your value (to a boolean)?
http://us3.php.net/manual/en
[mailto:randa...@gmail.com]
Sent: Monday, August 10, 2009 6:41 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Re: how to say inverse your value (to a boolean)?
http://us3.php.net/manual/en/language.operators.comparison.php
Find Ternary on that page.
It's a shortened conditional:
cond
8 matches
Mail list logo