array(10) { [1019]=> array(3) { [\"quantity\"]=> int(0) [\"revenue\"]=> int(0) [\"seller\"]=> string(5) \"Lenny\" } [1018]=> array(3) { [\"quantity\
I think what you need is uasort —
uasort
FROM PHP DOC
Sort an array with a user-defined comparison function and maintain index association
Example
uasort($stats, 'compare');