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

Javascript – Sorting an array of objects by date with some dates being null

I have a huge array of objects called steamData that look like this: { "sid": 1690, "store_url": "https://store.steampowered.com/app/1690", "store_promo_url": null, "store_uscore": 69, "published_store": "2006-10-16", "published_meta": "2006-10-16", "published_stsp": "2006-10-16", "published_hltb": "2020-04-18", "published_igdb": "2006-09-01", "image": "https://steamcdn-a.akamaihd.net/steam/apps/1690/header.jpg", "name": "Space Empires V", "description": "Space…

VIEW QUESTION
Back To Top
Search