Forums / Setup & design / Process matrix array / Comment26296
Maxime Thomas
Saturday 03 May 2008 12:51:48 am
I will do this like this :
$results = array(); $results[]='<item>'; foreach ($matrix_data as $index => $row) { $case = $index % 4; switch ($case) { case 0 : $results[]="<title>$row</tile>"; break; case 1: $results[]="<location>$row</location>"; break; case 2: $results[]="<fallback>$row</fallback>"; break; case 3 : $results[]="<image>$row</image>"; break; } } $results[]='</item>';
Maxime Thomas maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou Company Blog : http://www.wascou.org/eng/Company/Blog Technical Blog : http://share.ez.no/blogs/maxime-thomas