Good afternoon guys, I'm doing a ranking with 10 people, it's showing the 10, but I wanted to display in the descending order through the Value Score
<article class="rank">
<h2>Ranking de Jogadores Online</h2>
<?php
if(!is_array($aTotalPlayers) || count($aTotalPlayers) == 0){
echo '<br /><i>No players online!</i>';
} else {
?>
<table class="table table-striped table-bordered" style="width:600px;" align="center">
<tr>
<td><b>#</b></td>
<td><b>Nickname</b></td>
<td><b>Score</b></td>
</tr>
<?php
$i = 0;
foreach($aTotalPlayers as $id => $value){
if($i >= 10){
break;
}
$i++;
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo htmlentities($value['Nickname']); ?></td>
<td><?php echo $value['Score']; ?></td>
</tr>
<?php
}
echo '</table>';
}
?>
That is, I would have to display the 10 that have the highest score in the descending order, could you help me?