skip to Main Content

sort multi dimension array in php

PHP Format : $salesData["suppliers"][$supplierkey]['sales'][$salesPeriod]['sales'] I want to sort (desc): The key $salesData["suppliers"][$supplierkey] by the numerical value populated in $salesData["suppliers"][$supplierkey]['sales'][0]['cost'] So the following example: $salesData["suppliers"][Dong] $salesData["suppliers"][Ding] Would be changed to: $salesData["suppliers"][Ding] $salesData["suppliers"][Dong] Because $salesData["suppliers"][Ding][sales][0][cost] = 231.0600 $salesData["suppliers"][Dong][sales][0][cost] = 92.8900 Is it…

VIEW QUESTION
Back To Top
Search