php colors array red green blue foreach array_values items rows as key

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<?php
$colors = array('red','green','blue');
foreach(array_values($items['rows']) as $key=>$item):?>
<tr style=background-color:<?=$colors[$key%count($colors)];?>>
<td><center><?php print $item['about'];?></center></td>
<td><center><a href="<?php print sefRelToAbs('index.php?option='.$option.'&amp;Itemid='.$Itemid.'&amp;id=' . $item['id']);?>"><?php print $item['title'];?></a><center></td>
<td><center><?php print date('d.m.Y', strtotime($item['start']));?></center></td>
<td><center><?php print date('d.m.Y', strtotime($item['finish']));?></center></td>
<td><center><?php print $methods[$item['method']]['title'];?></center></td>
</tr>
<?php
}
endforeach;?>