I am trying to sort multidimensional array by values total in php.
[
c => [1=>22, 2=> 14, 3=> 55],
a => [7=> 33, 2=> 19, 51=> 43, 14=> 27],
...
]
since values total of a subarray are higher than in c, it should be first in this example. I would appreciate very much help regarding this problem.
uasort($arr, function($a, $b) { return array_sum($b) - array_sum($a);});