So, I have this type of array
$fields = array('result'=>234, '1'=>1, '2'=>2, '3'=>4, ....'20'=>5);
and I have o display it in a table, but the 'result' key has to be the last column. Until now I've used this approach, but the problem arrives as soon as i need to add other keys besides 'results', to the end of the table.
foreach($fields as $key=>$value) {
if(strcmp('key', 'result') != 0)
echo "<td>$value</td>";
}
echo "<td>$fields['result']</td>";
I assume that is has to be a better approach. What do you think?