Re: how to say "inverse your value" (to a boolean)?
| From: | tedd | Date: | Tue, 11 Aug 2009 13:09:25 +0000 |
| Subject: | Re: how to say "inverse your value" (to a boolean)? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296625@lists.php.net to get a copy of this message | ||
At 8:46 AM -0400 8/11/09, tedd wrote:
At 4:16 PM -0600 8/10/09, John Butler wrote:However, my solution (after reading others) is for an alternating row color (a boolean operation). The problem was NOT making every third row a different color or making every row a different color. Those problems would require different solutions. There is nothing wrong with embedding php within html, which is really a misnomer because it's the php interpreter that's sending the resultant html to the browser. It is not sending php snip-its for the browser to handle. So, embedding code such as: <tr class="row<?php echo($i++ & 1);?>"> Is a valid statement that works. It would be nice if you initialize the $i value, but it will work either way. My solution, provided via the above link, is a valid solution. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.comquick 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! -GJohn: Here's my solution: http://webbytedd.com/b/color-rows/ Cheers, tedd