This feels like a stupid question, but it's one that's beyond me at the moment.
I want to build table rows using 3 different arrays, one for each table cell.
foreach ($array_1 as $this_1)
print "<td>Blah1</td> \n";
foreach ($array_2 as $this_2)
print "<td style=\"text-align:center;\">Blah2</td> \n";
foreach ($array_3 as $this_3)
print "<td style=\"text-align:center;\">Blah3</td></tr> \n";
Of course, what's happening is it's doing 30 cells for $array_1, then 30 cells for $array_2 and then 30 cells for $array_3. I'd like it to do 1 cell from the first array, 1 cell from the second array, one cell from the third array, repeat 30 times.
Help much appreciated, thank you.
Last edited by TygerTyger; 12-17-2006 at 02:14 PM.
In the previously posted example, if some reason $array_3 were not to be set, the entire WHILE would come to a screeching halt. If you prefer using that code, you should consider changing the AND condition to an OR. this would ensure that the loop woud continue to proceed as long as data kept coming in from a least one of the arrays.