karldesign Posted September 14, 2007 Share Posted September 14, 2007 Hey, I Have an array set as so: $temparr[$i]['score'] = 3.4 $temparr[$i]['id'] = 1 $temparr[$i]['title'] = 'title' $i loops the array populating it, but when I output the array, i would like to sort it by the 'score' value asc or desc, depending on what i want to show... what is the easiest way of achieving this? Quote Link to comment https://forums.phpfreaks.com/topic/69309-sorting-a-multidimensional-array/ Share on other sites More sharing options...
redarrow Posted September 14, 2007 Share Posted September 14, 2007 http://uk2.php.net/array_multisort Quote Link to comment https://forums.phpfreaks.com/topic/69309-sorting-a-multidimensional-array/#findComment-348275 Share on other sites More sharing options...
karldesign Posted September 14, 2007 Author Share Posted September 14, 2007 I've tried searching through that page, but as of yet, havent been able to find anything that does what I want/works? Quote Link to comment https://forums.phpfreaks.com/topic/69309-sorting-a-multidimensional-array/#findComment-348279 Share on other sites More sharing options...
Barand Posted September 14, 2007 Share Posted September 14, 2007 see http://www.phpfreaks.com/forums/index.php/topic,154718.msg670104.html#msg670104 Quote Link to comment https://forums.phpfreaks.com/topic/69309-sorting-a-multidimensional-array/#findComment-348296 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.