crashmaster Posted January 4, 2008 Share Posted January 4, 2008 I have an array Array ( [35] => 4.7143 [85] => 4.4286 [17] => 4.6667 [91] => 4.5 [86] => 4.1667 [83] => 4.3333 [87] => 4.8 [93] => 5 [23] => 4.8 [22] => 5 [40] => 5 [90] => 5 [92] => 5 [55] => 4.3333 [52] => 5 [53] => 5 [56] => 5 [39] => 5 [94] => 5 [89] => 5 ) How to sort it by values ?? Not by KEY, but by VALUES. Thanks Link to comment https://forums.phpfreaks.com/topic/84468-solved-array-sort/ Share on other sites More sharing options...
Daniel0 Posted January 4, 2008 Share Posted January 4, 2008 sort() or if you wish to retain the key associations asort() Link to comment https://forums.phpfreaks.com/topic/84468-solved-array-sort/#findComment-430345 Share on other sites More sharing options...
crashmaster Posted January 4, 2008 Author Share Posted January 4, 2008 I more question. what about DESC sorting ? Link to comment https://forums.phpfreaks.com/topic/84468-solved-array-sort/#findComment-430347 Share on other sites More sharing options...
Daniel0 Posted January 4, 2008 Share Posted January 4, 2008 rsort() and arsort() Link to comment https://forums.phpfreaks.com/topic/84468-solved-array-sort/#findComment-430349 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.