Estuve investigando por todos lados y aún así no he encontrado una solución para mi problema:
Tengo un array multidimensional el cual construyo desde una consulta a MySQL y me devuelve lo siguiente:
Array ( [51] => Array ( [name] => Kiwi-Fresa Sin Azúcar [value] => 19 ) [58] => Array ( [name] => Pan de muerto [value] => 20 ) [14] => Array ( [name] => Mango sin azúcar [value] => 16 ) [15] => Array ( [name] => Limón [value] => 11 ) [2] => Array ( [name] => Avellana Sin Azúcar [value] => 17 ) [21] => Array ( [name] => Pistache [value] => 4 ) [28] => Array ( [name] => Chocolate con Avellana [value] => 3 ) [23] => Array ( [name] => Stracciatella [value] => 7 ) [39] => Array ( [name] => Vainilla [value] => 14 ) [22] => Array ( [name] => Chocolate Belga [value] => 5 ) [31] => Array ( [name] => Pera Sin Azúcar [value] => 4 ) [17] => Array ( [name] => Mamey [value] => 3 ) [27] => Array ( [name] => Tiramisú [value] => 3 ) [60] => Array ( [name] => Te Chai [value] => 1 ) [18] => Array ( [name] => Mandarina sin azúcar [value] => 8 ) )
O en jSON (que es como realmente lo imprimo para pasarlo a JS):
{"51":{"name":"Kiwi-Fresa Sin Az\u00facar","value":19},"58":{"name":"Pan de muerto","value":20},"14":{"name":"Mango sin az\u00facar","value":16},"15":{"name":"Lim\u00f3n ","value":11},"2":{"name":"Avellana Sin Az\u00facar ","value":17},"21":{"name":"Pistache","value":4},"28":{"name":"Chocolate con Avellana","value":3},"23":{"name":"Stracciatella","value":7},"39":{"name":"Vainilla ","value":14},"22":{"name":"Chocolate Belga","value":5},"31":{"name":"Pera Sin Az\u00facar ","value":4},"17":{"name":"Mamey","value":3},"27":{"name":"Tiramis\u00fa","value":3},"60":{"name":"Te Chai","value":"1"},"18":{"name":"Mandarina sin az\u00facar","value":8}}
Mi duda es cómo puedo ordenar este arreglo de manera ascendente o descendente teniendo en cuenta la llave "value"