RE: [PHP] Re: how to say inverse your value (to a boolean)?

2009-08-11 Thread Ford, Mike
-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

[PHP] Re: how to say inverse your value (to a boolean)?

2009-08-10 Thread Tony Marston
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:

[PHP] Re: how to say inverse your value (to a boolean)?

2009-08-10 Thread Ralph Deffke
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

[PHP] Re: how to say inverse your value (to a boolean)?

2009-08-10 Thread Ralph Deffke
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

Re: [PHP] Re: how to say inverse your value (to a boolean)?

2009-08-10 Thread John Butler
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

Re: [PHP] Re: how to say inverse your value (to a boolean)?

2009-08-10 Thread Adam Randall
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 ?

RE: [PHP] Re: how to say inverse your value (to a boolean)?

2009-08-10 Thread Daevid Vincent
://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

Re: [PHP] Re: how to say inverse your value (to a boolean)?

2009-08-10 Thread 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/language.operators.comparison.php Find Ternary on that page. It's a shortened conditional: cond