Huijari Posted April 21, 2010 Share Posted April 21, 2010 If I have array with keys [1] [12] and [25] So when I use ksort($array) it will set first 1, then 12 and last 25. I want it to act like it sets first 25, then 12 then 1 So when 1 its at the end, when big its first in array. How to do this? Link to comment https://forums.phpfreaks.com/topic/199259-sort-array-by-depending-the-key-number/ Share on other sites More sharing options...
Pikachu2000 Posted April 21, 2010 Share Posted April 21, 2010 krsort() Link to comment https://forums.phpfreaks.com/topic/199259-sort-array-by-depending-the-key-number/#findComment-1045809 Share on other sites More sharing options...
Huijari Posted April 21, 2010 Author Share Posted April 21, 2010 thanks, works like a dream. This really helps me with my project Link to comment https://forums.phpfreaks.com/topic/199259-sort-array-by-depending-the-key-number/#findComment-1045838 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.