sorting - Sort an array in descending order php -
i have array:
array ( [0] => 0px 0px [1] => -101px 0px [2] => -205px -3px [3] => 0px -77px [4] => -100px -80px [5] => -202px -80px )
i sort in order have:
array ( [0] => -202px -80px [1] => -100px -80px [2] => 0px -77px [3] => -205px -3px [4] => -101px 0px [5] => 0px 0px )
based on research, ksort() supposed trick im having 1.
could please tell me doing wrong. thanks
use array_reverse()
: http://php.net/array_reverse
it reverses array order name suggests.
Comments
Post a Comment