0

I have following array:

   $array[0]["nbr1"] = 5;

   $array[0]["nbr2"] = 7;

   $array[1]["nbr1"] = 1;

   $array[1]["nbr2"] = 6;

   $array[2]["nbr1"] = 2;

   $array[2]["nbr2"] = 3;

How can I sort this array first by "nbr1" descending and than by "nbr2" descending? I tried different things that were explained on the web but none of them worked for this scenario.

Thx

Joren Willems
  • 167
  • 1
  • 6
  • 12
  • 1
    [Canonical reference about sorting arrays in php.](http://stackoverflow.com/questions/17364127/reference-all-basic-ways-to-sort-arrays-and-data-in-php) – HamZa Nov 21 '13 at 12:00

1 Answers1

0
array_multisort($array[1], SORT_DESC, SORT_STRING);
superphonic
  • 7,954
  • 6
  • 30
  • 63