<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Alternating row classes in PHP, easy style</title>
	<atom:link href="http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/</link>
	<description>blog, webdesign, illustration &#38; newsk00l javascript</description>
	<lastBuildDate>Thu, 09 Feb 2012 09:09:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Clemens Lang</title>
		<link>http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/comment-page-1/#comment-170580</link>
		<dc:creator>Clemens Lang</dc:creator>
		<pubDate>Sat, 14 Jun 2008 01:58:13 +0000</pubDate>
		<guid isPermaLink="false">http://komodomedia.com/blog/index.php/2007/03/30/alternating-row-classes-in-php-easy-style/#comment-170580</guid>
		<description>There are a couple of approaches to this problem, and if you really want to keep low on lines of code, you should do something like print($myAltRow = (empty($myAltRow) ? &#039;odd&#039; : &#039;&#039;));
Using the fact that a variable assignment returns the assigned value in PHP here.</description>
		<content:encoded><![CDATA[<p>There are a couple of approaches to this problem, and if you really want to keep low on lines of code, you should do something like print($myAltRow = (empty($myAltRow) ? &#8216;odd&#8217; : &#8221;));<br />
Using the fact that a variable assignment returns the assigned value in PHP here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mihangel Caiaphas</title>
		<link>http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/comment-page-1/#comment-107815</link>
		<dc:creator>Mihangel Caiaphas</dc:creator>
		<pubDate>Sun, 21 Oct 2007 20:04:05 +0000</pubDate>
		<guid isPermaLink="false">http://komodomedia.com/blog/index.php/2007/03/30/alternating-row-classes-in-php-easy-style/#comment-107815</guid>
		<description>when they say it&#039;s ove. Mihangel Caiaphas.</description>
		<content:encoded><![CDATA[<p>when they say it&#8217;s ove. Mihangel Caiaphas.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martino Heino</title>
		<link>http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/comment-page-1/#comment-88765</link>
		<dc:creator>Martino Heino</dc:creator>
		<pubDate>Wed, 19 Sep 2007 18:02:11 +0000</pubDate>
		<guid isPermaLink="false">http://komodomedia.com/blog/index.php/2007/03/30/alternating-row-classes-in-php-easy-style/#comment-88765</guid>
		<description>see it started at the park,used to chill after dar. Martino Heino.</description>
		<content:encoded><![CDATA[<p>see it started at the park,used to chill after dar. Martino Heino.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dieter</title>
		<link>http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/comment-page-1/#comment-74811</link>
		<dc:creator>Dieter</dc:creator>
		<pubDate>Wed, 15 Aug 2007 16:48:10 +0000</pubDate>
		<guid isPermaLink="false">http://komodomedia.com/blog/index.php/2007/03/30/alternating-row-classes-in-php-easy-style/#comment-74811</guid>
		<description>I did it like this, a bit longer:
http://www.dio5.com/blog/2007/03/06/Zebra_tables_with_PHP</description>
		<content:encoded><![CDATA[<p>I did it like this, a bit longer:<br />
<a href="http://www.dio5.com/blog/2007/03/06/Zebra_tables_with_PHP" rel="nofollow">http://www.dio5.com/blog/2007/03/06/Zebra_tables_with_PHP</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/comment-page-1/#comment-55525</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Fri, 29 Jun 2007 15:42:59 +0000</pubDate>
		<guid isPermaLink="false">http://komodomedia.com/blog/index.php/2007/03/30/alternating-row-classes-in-php-easy-style/#comment-55525</guid>
		<description>That&#039;s very clever. I&#039;ve seen this &quot;problem&quot; tackled in many ways, but that&#039;s a new one to me. Nice! :)</description>
		<content:encoded><![CDATA[<p>That&#8217;s very clever. I&#8217;ve seen this &#8220;problem&#8221; tackled in many ways, but that&#8217;s a new one to me. Nice! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben McNelly</title>
		<link>http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/comment-page-1/#comment-47779</link>
		<dc:creator>Ben McNelly</dc:creator>
		<pubDate>Tue, 05 Jun 2007 21:36:20 +0000</pubDate>
		<guid isPermaLink="false">http://komodomedia.com/blog/index.php/2007/03/30/alternating-row-classes-in-php-easy-style/#comment-47779</guid>
		<description>Still alive buddy?</description>
		<content:encoded><![CDATA[<p>Still alive buddy?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lara</title>
		<link>http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/comment-page-1/#comment-44258</link>
		<dc:creator>Lara</dc:creator>
		<pubDate>Thu, 24 May 2007 21:10:48 +0000</pubDate>
		<guid isPermaLink="false">http://komodomedia.com/blog/index.php/2007/03/30/alternating-row-classes-in-php-easy-style/#comment-44258</guid>
		<description>And I&#039;ve finally understood the snappy little trick for alternating comment boxes. Excellento. Thanks!</description>
		<content:encoded><![CDATA[<p>And I&#8217;ve finally understood the snappy little trick for alternating comment boxes. Excellento. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rogie</title>
		<link>http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/comment-page-1/#comment-37930</link>
		<dc:creator>Rogie</dc:creator>
		<pubDate>Thu, 03 May 2007 19:56:50 +0000</pubDate>
		<guid isPermaLink="false">http://komodomedia.com/blog/index.php/2007/03/30/alternating-row-classes-in-php-easy-style/#comment-37930</guid>
		<description>@anonymous:  Yeah, cool function as well, however in your case you&#039;ll always &lt;strong&gt;HAVE&lt;/strong&gt; to keep incrementing an $i variable.  For for loops using $i, you are golden, for foreach loops over an object, its nice to not have to create another variable and increment it.</description>
		<content:encoded><![CDATA[<p>@anonymous:  Yeah, cool function as well, however in your case you&#8217;ll always <strong>HAVE</strong> to keep incrementing an $i variable.  For for loops using $i, you are golden, for foreach loops over an object, its nice to not have to create another variable and increment it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anonymus</title>
		<link>http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/comment-page-1/#comment-37887</link>
		<dc:creator>anonymus</dc:creator>
		<pubDate>Thu, 03 May 2007 16:43:40 +0000</pubDate>
		<guid isPermaLink="false">http://komodomedia.com/blog/index.php/2007/03/30/alternating-row-classes-in-php-easy-style/#comment-37887</guid>
		<description>Well there&#039;s a faster solution for this problem.
Try $row_class = $i&amp;1?&#039;alt&#039;:&#039;&#039;;
It is also very nice - just one line.

Jonathan Snook wrote about this before: http://snook.ca/archives/php/the_modulo_oper/</description>
		<content:encoded><![CDATA[<p>Well there&#8217;s a faster solution for this problem.<br />
Try $row_class = $i&amp;1?&#8217;alt&#8217;:&#8221;;<br />
It is also very nice &#8211; just one line.</p>
<p>Jonathan Snook wrote about this before: <a href="http://snook.ca/archives/php/the_modulo_oper/" rel="nofollow">http://snook.ca/archives/php/the_modulo_oper/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rogie</title>
		<link>http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/comment-page-1/#comment-34597</link>
		<dc:creator>Rogie</dc:creator>
		<pubDate>Mon, 16 Apr 2007 22:45:22 +0000</pubDate>
		<guid isPermaLink="false">http://komodomedia.com/blog/index.php/2007/03/30/alternating-row-classes-in-php-easy-style/#comment-34597</guid>
		<description>@Everyone: I think you guys are missing the beauty of this code.  You can use a foreach, you can use a for..., you can have it in a while loop. Basically, all you need is one line, not three lines of if statements:

&lt;code&gt;$row_class = empty($row_class)? &quot;alt&quot; : &quot;&quot;;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>@Everyone: I think you guys are missing the beauty of this code.  You can use a foreach, you can use a for&#8230;, you can have it in a while loop. Basically, all you need is one line, not three lines of if statements:</p>
<p><code>$row_class = empty($row_class)? "alt" : "";</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Served from: komodomedia.com @ 2012-02-11 16:47:05 by W3 Total Cache -->
