0

I have some values

1999
1899
1600

I order them by doing:

asort($postOrdered);

But I need them in the opposite order, I tried

asort($postOrdered);

then 

ksort($postOrdered);

but they get wrong while if I keep asort() it works fine

rob.m
  • 8,256
  • 14
  • 65
  • 119

1 Answers1

0

asort() - Sorts an associative array in ascending order, according to the value

arsort() - Sorts an associative array in descending order, according to the value

ksort() - Sorts an associative array in ascending order, according to the key

krsort() - Sorts an associative array in descending order, according to the key

sort() - Sorts an indexed array in ascending order

rsort() - Sorts an indexed array in descending order

usort() - Sorts an array using a user-defined comparison function

uksort() - Sorts an array by keys using a user-defined comparison function

uasort() - Sorts an array by values using a user-defined comparison function

natsort() - Sorts an array using a "natural order" algorithm

natcasesort() - Sorts an array using a case insensitive "natural order" algorithm

array_multisort() - Sorts multiple or multi-dimensional arrays

Lublaut
  • 314
  • 4
  • 11