I don't know how your homework is specifically worded but if its that you can't use asort
or ksort
then you can do things like ...
function my_sort(&$my_array){
arsort($my_array); // not using asort were using arsort
$my_array = array_reverse($my_array,true);
}