I trust you are well.
I would like to try and sort this array by the score property of the object. Below is an example of the data (print_r).
Array
(
[0] => stdClass Object
(
[device] => 352454530452548
[reg] => MAM 432A
[distance] => 823.36
[ha_points] => 1
[hb_points] => 235
[hc_points] => 7.5
[idling_points] => 111.5
[speeding_points] => 168
[total] => 523
[score] => 68.239895064127
)
[1] => stdClass Object
(
[device] => 3518020541565265
[reg] => SM** ***
[distance] => 851.07
[ha_points] => 14
[hb_points] => 136
[hc_points] => 6
[idling_points] => 50
[speeding_points] => 336
[total] => 542
[score] => 68.957730856451
)
The score can be anything from 0 to 100 and I would like to sort them into descending order (biggest first?). To make things more complicated, although the chances are very slim it is possible to have two identical scores in which case it doesn't matter which one is first.
Any ideas?
Thanks in advance,
Paul