Sorting 2D associative arrays in PHP
July 13th, 2009 | by Knix | published in php
Surprisingly, it took me a long time to find this solution so I decided to post it for anyone who had a situation similar to mine.
Let’s say you have the following 2D associative array in PHP of fruits and their corresponding prices and you want to have them sorted by price:
$fruits = array
(
[...]