What would an entire loop look like?
<?
$my_favorite_things = array (
"color" => "blue",
"musician" => "Bjork",
"song" => "New World",
"os" => "Linux Mandrake",
"food" => "Pop Tarts",
"language" => "PHP4");
print "<table>";
while (list($thing, $value) = each ($my_favorite_things))
{
$row = 1-$row;
$color = ($row==0)?"#ffff00":"#00ffff";
print "<tr bgcolor=$color><td>$thing</td><td>$value</td></tr>";
}
print "</table>";
?>
here's the most efficient way I've found to change HTML table row colors as you loop through an array of info:
$row = 1-$row;
$color = ($row==0)?"#eeeeee":"#ffffff";