• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please help, Iarray sort not working

Hello. Please somebody help..I want to arrange the foreach loop according to the highest number of average exam score. 
I used rsort or sort array but it returns zero.
see my code:

$this->db->where('class_id' , $class_id);
$this->db->where('year' , $running_year);
$number_of_subjects = $this->db->count_all_results();
$average_score= ($total_marks / $number_of_subjects);
after i get the highest average score i want to rank it as 1st,2nd, 3rd....
Kindly help

rsort requires an array. You appear to be trying to sort a single variable. https://www.php.net/manual/en/function.rsort.php

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.