I've redone the tests with 50,000 rows and added the multi echo in 1 tag method too
for ($j=0;$j<30;$j++) {
foreach ($results as $key=>$val){
?>
<tr>
<td><?php echo $results[$key][0]?></td>
<td><?php echo $results[$key][1]?></td>
<td><?php echo $results[$key][2]?></td>
<td><?php echo $results[$key][3]?></td>
<td><?php echo $results[$key][4]?></td>
<td><?php echo $results[$key][5]?></td>
<td><?php echo $results[$key][6]?></td>
<td><?php echo $results[$key][7]?></td>
<td><?php echo $results[$key][8]?></td>
<td><?php echo $results[$key][9]?></td>
<td><?php echo $results[$key][10]?></td>
<td><?php echo $results[$key][11]?></td>
<td><?php echo $results[$key][12]?></td>
<td><?php echo $results[$key][13]?></td>
<td><?php echo $results[$key][14]?></td>
</tr>
<?php
}
}
duration1: 31.15542483 Seconds
for ($k=0;$k<30;$k++) {
foreach ($results as $key1=>$val1){
echo
'<tr>
<td>'.$results[$key1][0].'</td>
<td>'.$results[$key1][1].'</td>
<td>'.$results[$key1][2].'</td>
<td>'.$results[$key1][3].'</td>
<td>'.$results[$key1][4].'</td>
<td>'.$results[$key1][5].'</td>
<td>'.$results[$key1][6].'</td>
<td>'.$results[$key1][7].'</td>
<td>'.$results[$key1][8].'</td>
<td>'.$results[$key1][9].'</td>
<td>'.$results[$key1][10].'</td>
<td>'.$results[$key1][11].'</td>
<td>'.$results[$key1][12].'</td>
<td>'.$results[$key1][13].'</td>
<td>'.$results[$key1][14].'</td>
</tr>';
}
}
duration2: 30.23169804 Seconds
for ($l=0;$l<30;$l++) {
foreach ($results as $key2=>$val2){
echo'<tr>';
echo'<td>'.$results[$key2][0].'</td>';
echo'<td>'.$results[$key2][1].'</td>';
echo'<td>'.$results[$key2][2].'</td>';
echo'<td>'.$results[$key2][3].'</td>';
echo'<td>'.$results[$key2][4].'</td>';
echo'<td>'.$results[$key2][5].'</td>';
echo'<td>'.$results[$key2][6].'</td>';
echo'<td>'.$results[$key2][7].'</td>';
echo'<td>'.$results[$key2][8].'</td>';
echo'<td>'.$results[$key2][9].'</td>';
echo'<td>'.$results[$key2][10].'</td>';
echo'<td>'.$results[$key2][11].'</td>';
echo'<td>'.$results[$key2][12].'</td>';
echo'<td>'.$results[$key2][13].'</td>';
echo'<td>'.$results[$key2][14].'</td>';
echo'</tr>';
}
}
duration3: 27.54640007 Seconds
Not much difference between the original 2 methods, but looks like it's quite a bit faster with less concatenation @poke
Since I doubt I'll need this much data in 1 go, I guess I'll continue to use many tags, code indentation looks neater and 'view source' layout more accurate