When I try to apply the below code from here
usort($myArray, function($a, $b) {
return $a['order'] - $b['order'];
});
it gives me results in ascending order.
Output:
0
0
0
0
0
0.29
1.09
6.33
On swapping $a and $b it gives the results in descending order except one value
usort($myArray, function($a, $b) {
return $b['order'] - $a['order'];
});
Output:
6.33
1.09
0
0
0
0
0.29
0
i want to have the results in the below order:
6.33
1.09
0.29
0
0
0
0
0
How do i achieve the same.?