I have the following array output.
Array
(
[0] => Array
(
[student_id] => 39
[scored] => 50
[out_of] => 100
)
[1] => Array
(
[student_id] => 40
[scored] => 80
[out_of] => 100
)
)
I want to calculate the percentage of the student and want to show the student on top whose percentage is higher. how do i do it? Can i change the order in the array itself? please help
I want the array to be like this
Array
(
[0] => Array
(
[student_id] => 40
[scored] => 80
[out_of] => 100
)
[1] => Array
(
[student_id] => 39
[scored] => 50
[out_of] => 100
)
)