EagerWolf Posted May 9, 2007 Share Posted May 9, 2007 I am trying to sort array alphabetically ... But I have a problem.. $array = array( '1' => 'a', '2' => 'c', '3' => 'b' ); When I sort this array I get this: [code] $array = array( '1' => 'a', '2' => 'b', '3' => 'c' ); But I want to get this: [code] $array = array( '1' => 'a', '3' => 'b', '2' => 'c' ); I want key words to be sorted as well ... Thanks for your help![/code][/code] Quote Link to comment https://forums.phpfreaks.com/topic/50629-sort-array-alphabeticaly/ Share on other sites More sharing options...
c_shelswell Posted May 9, 2007 Share Posted May 9, 2007 Hi i found something great for this if you go to http://uk.php.net/usort then search for arfsort it's the second post (you'll find 2 arfsorts) posted by martin # classaxe com <><16-May-2006 08:07 hope this helps Quote Link to comment https://forums.phpfreaks.com/topic/50629-sort-array-alphabeticaly/#findComment-248863 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.