sort array in DESC order

后端 未结 4 1779
情深已故
情深已故 2020-12-30 07:28

How can i sort this array by arrray key

array(
4 => \'four\',
3 => \'three\',
2 => \'two\',
1 => \'one\',
)

like this



        
4条回答
  •  無奈伤痛
    2020-12-30 08:29

    Try krsort() - that will sort in reverse using the array key, whereas rsort will sort on the array value.

提交回复
热议问题