I am trying to generate a student tabulation sheet. How can I display students details with ranking according to Marks & GPA(Descending). currently I can display by either Marks or GPA with the following code:
arsort($myGpa);
foreach($myGpa as $x=>$myValue)
{
?>
<tr>
<td><?php echo $sn++; ?></td>
<td><?php echo $myName[$x]; ?></td>
<td><?php echo $myCadet[$x]; ?></td>
<td><?php echo $myTotal[$x]; ?></td>
<td><?php echo $myGrade[$x]; ?></td>
<td><?php echo number_format($myValue,2); ?> </td>
<td><?php //$position++;
$myposition = $position++;
if($myposition == '1') { echo '1st'; }
else if($myposition == '2') { echo '2nd'; }
else if($myposition == '3') { echo '3rd'; }
else echo $myposition.'th';
?> </td>
</tr>
and another thing is: if the marks & gpa are same then how to show the position ? thanks in advance.