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

2009-08-12 Thread Jim Lucas
Cc: PHP-General List Subject: Re: [PHP] how to say inverse your value (to a boolean)? John Butler wrote: 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

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

2009-08-12 Thread tedd
At 8:33 AM -0700 8/12/09, Jim Lucas wrote: Daevid Vincent wrote: -snip- I side with Jim on this. I never use short tags and write similar crap. Jim said: I have found, in a number of cases, that using only the TR tag doesn't work all the time. It should work ALL the time, but sometimes

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

2009-08-12 Thread Ralph Deffke
thats why I decided years ago to write myself a little bunch of classes for the html tags which gives me the ability to have PHP only code, very nice, no errors and my outputs dont even need Tidy pure XHTML i find these idear of mixing html and php as spagetty, using divs for tables as something

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

2009-08-11 Thread Ford, Mike
-Original Message- From: Daevid Vincent [mailto:dae...@daevid.com] Sent: 11 August 2009 02:19 Then YOU have more aggressive error_reporting than the default setting turned on. You might consider turning it down a notch. NOTICEs are basically useless and bloat your code IMHO --

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

2009-08-11 Thread David Otton
2009/8/11 Daevid Vincent dae...@daevid.com: NO! For the love of God and all that is holy, don't do that accumulator / mod hack. That's so 1980's. And why make the CPU do all that math for every row... Just do this. It's quick and simple: CSS:        .dataRow1 { background-color:

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

2009-08-11 Thread Ashley Sheridan
On Tue, 2009-08-11 at 11:28 +0100, David Otton wrote: 2009/8/11 Daevid Vincent dae...@daevid.com: NO! For the love of God and all that is holy, don't do that accumulator / mod hack. That's so 1980's. And why make the CPU do all that math for every row... Just do this. It's quick

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

2009-08-11 Thread Ralph Deffke
seems they changing idears on the fly? could it be that the designer is a smal ugly person while u a a good looking ladykiller ? on that background I would design a function where u can change ti what ever u want on the fly something like this var $a; function alternate( $a, $_b=array( red, red

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

2009-08-11 Thread tedd
and books, but can't remember (nor find now) in PHP how to say inverse your value (to a boolean). ? TIA! -G John: Here's my solution: http://webbytedd.com/b/color-rows/ Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List

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

2009-08-11 Thread tedd
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 John: Here's my solution: http://webbytedd.com/b/color-rows/ Cheers, tedd However, my solution (after reading others) is for an alternating row

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

2009-08-11 Thread Martin Scotta
. $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 John: Here's my solution: http://webbytedd.com/b/color-rows/ Cheers

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

2009-08-11 Thread Conor Mac Aoidh
) in PHP how to say inverse your value (to a boolean). ? TIA! -G If I was going to do that then I would use jQuery: script type=text/javascript $(document).ready(function(){ $(table tr:even).addClass(even);; $(table tr:odd).addClass(odd);; }); /script And yes I know

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

2009-08-11 Thread tedd
and books, but can't remember (nor find now) in PHP how to say inverse your value (to a boolean). ? TIA! -G If I was going to do that then I would use jQuery: script type=text/javascript $(document).ready(function(){ $(table tr:even).addClass(even);; $(table tr:odd).addClass(odd

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

2009-08-11 Thread tedd
At 10:27 AM -0300 8/11/09, Martin Scotta wrote: A change request just came in - the interaction designer wants every third line to have a grey background, instead of every second line. # before was $styles = array( 'even', 'odd' ); # after new requirements it is... $styles = array( 'white',

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

2009-08-11 Thread Ben Dunlap
# before was $styles = array( 'even', 'odd' ); # after new requirements it is... $styles = array( 'white', 'white', 'gray' ); foreach($items as $item) { printf( 'li class=%s%s/li', current( $styles ), $item ); next( $styles ) or reset( $styles ); } +5000. I think is by far the most

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

2009-08-11 Thread Robert Cummings
Ben Dunlap wrote: # before was $styles = array( 'even', 'odd' ); # after new requirements it is... $styles = array( 'white', 'white', 'gray' ); foreach($items as $item) { printf( 'li class=%s%s/li', current( $styles ), $item ); next( $styles ) or reset( $styles ); } +5000. I think is by far

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

2009-08-11 Thread Ben Dunlap
# before was $styles = array( 'even', 'odd' ); # after new requirements it is... $styles = array( 'white', 'white', 'gray' ); foreach($items as $item) { printf( 'li class=%s%s/li', current( $styles ), $item ); next( $styles ) or reset( $styles ); } +5000. I think is by far the most

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

2009-08-11 Thread John Butler
What a lot of good ideas spawned from the OP! I am learning many things,.. while also actually working (paying bills), so I regularly have to just go with what I know well. Anyway, I already have the forearch { loop (for other reasons it is necessary), and I only needed one color to

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

2009-08-11 Thread tedd
At 1:53 PM -0600 8/11/09, John Butler wrote: What a lot of good ideas spawned from the OP! I am learning many things,.. while also actually working (paying bills), so I regularly have to just go with what I know well. Anyway, I already have the forearch { loop (for other reasons it is

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

2009-08-11 Thread John Butler
What a lot of good ideas spawned from the OP! I am learning many things,.. while also actually working (paying bills), so I regularly have to just go with what I know well. Anyway, I already have the forearch { loop (for other reasons it is necessary), and I only needed one color to

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

2009-08-11 Thread Robert Cummings
John Butler wrote: What a lot of good ideas spawned from the OP! I am learning many things,.. while also actually working (paying bills), so I regularly have to just go with what I know well. Anyway, I already have the forearch { loop (for other reasons it is necessary), and I only needed

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

2009-08-11 Thread John Butler
He's pointing out a typo... forearch instead of foreach :) LOL! I almost always miss the jokes. Thanks for the smiley face to get my (lighter) attention ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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

2009-08-11 Thread Daevid Vincent
thru' docs and books, but can't remember (nor find now) in PHP how to say inverse your value (to a boolean). ? TIA! -G ?php $arr = range(1, 10); $i = 0; foreach ( $arr AS $row ) { $row_color = ( ( $i++ % 2 ) ? 'green' : 'red'); echo $row_color

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

2009-08-10 Thread John Butler
) in PHP how to say inverse your value (to a boolean). ? TIA! -G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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

2009-08-10 Thread Martin Scotta
{} 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

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

2009-08-10 Thread Daevid Vincent
: Jim Lucas [mailto:li...@cmsws.com] Sent: Monday, August 10, 2009 4:03 PM To: John Butler Cc: PHP-General List Subject: Re: [PHP] how to say inverse your value (to a boolean)? John Butler wrote: quick Q: I have this inside a foreach{} that I want to alternate between on and off so

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

2009-08-10 Thread Martin Scotta
[mailto:li...@cmsws.com] Sent: Monday, August 10, 2009 4:03 PM To: John Butler Cc: PHP-General List Subject: Re: [PHP] how to say inverse your value (to a boolean)? John Butler wrote: quick Q: I have this inside a foreach{} that I want to alternate between on and off so I can

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

2009-08-10 Thread Daevid Vincent
. -Original Message- From: Martin Scotta [mailto:martinsco...@gmail.com] Sent: Monday, August 10, 2009 5:39 PM To: Daevid Vincent Cc: PHP-General List Subject: Re: [PHP] how to say inverse your value (to a boolean)? Use... $dr = !$dr if you want Notice: Undefined variable: dr All

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

2009-08-10 Thread Paul M Foster
On Mon, Aug 10, 2009 at 04:18:29PM -0700, Daevid Vincent wrote: NO! For the love of God and all that is holy, don't do that accumulator / mod hack. That's so 1980's. And why make the CPU do all that math for every row... Just do this. It's quick and simple: CSS: .dataRow1 {

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

2009-08-10 Thread Jim Lucas
- From: Jim Lucas [mailto:li...@cmsws.com] Sent: Monday, August 10, 2009 4:03 PM To: John Butler Cc: PHP-General List Subject: Re: [PHP] how to say inverse your value (to a boolean)? John Butler wrote: quick Q: I have this inside a foreach{} that I want to alternate between on and off so I can