Posted by comatose on 02/23/07 23:32
Newbie here:
can anyone help me, i've been beating my brain on this one.
how can i sort from highest to lowest for $player_wins[$i] ??
echo "<table width='300' border='1' cellspacing='0' cellpadding='2' bgcolor='#FBFFC6'>";
echo "<tr><th width='180'>Player</th><th width='40'>Won</th><th width='40'>lost</th><th
width='40'>Avg.</th>";
for($i=0;$i<=$counter;$i++){
if ($player_name[$i] != ""){
$avg = ($player_wins[$i]/($player_wins[$i]+$player_loss[$i]));
echo
"<tr><td>".$player_name[$i]."</td><td>".$player_wins[$i]."</td><td>".$player_loss[$i]."</td><td>".round($avg,3)."</td></tr>";
}
}
echo "</table>";
[Back to original message]
|