I need to sort this array below, in descending order, but I'm currently stuck and can't think of a simple solution.
This is the array structure:
$data = Array ( [Name1] => Array ( [1] => 40-45 [0] => 124791.63 ) [Name2] => Array ( [1] => 46 [0] => 2624.7 ) [Name3] => Array ( [1] => 50 [0] => 37784.27 ) [Name4] => Array ( [1] => 52 [0] => 1008 ) )
I want to sort it by value $data[Name1][0], in the descending order, as you can see the current array is not sorted since the values go like this:
124791.63 -- 2624.7 -- 37784.27 ...etc
Is there any simple solution to this? I googled, but I couldn't find an answer to this specific problem.