I have an array like one mentioned below
Array
(
[6] => Array
(
[name] => Extras
[total_products] => 0
[total_sales] => 0
[total_affiliation] => 0
)
[5] => Array
(
[name] => Office Products
[total_products] => 7
[total_sales] => 17
[total_affiliation] => 8
)
[1] => Array
(
[name] => Hardware Parts
[total_products] => 6
[total_sales] => 0
[total_affiliation] => 0
)
)
Right now, order is: Extras, Office Products, Hardware Parts
I want to sort main array in such as way that it is order by total_sales of inner-array in desc order
so order will be: Office Products, Extras, Hardware Parts
Any help guys