0

How do I sort a created list on it's value ? this is my result :

array (size=10)
  1 => int 0
  2 => int 2
  3 => int 3
  4 => int 2
  5 => int 2
  6 => int 1
  7 => int 0
  8 => int 2
  9 => int 1
  10 => int 2

While this is what I want to have :

array (size=10)
  3 => int 3
  2 => int 2
  4 => int 2
  5 => int 2
  8 => int 2
  10 => int 2 
  6 => int 1  
  9 => int 1
  1 => int 0
  7 => int 0 
Awa
  • 160
  • 1
  • 3
  • 11

1 Answers1

0

You should have a look at the php array sort functions, you'll probably need something like this...

$array = arsort($array);
Duenna
  • 1,359
  • 2
  • 11
  • 15