IMakeLousyCode Posted September 11, 2006 Share Posted September 11, 2006 Hi, Is there an easy way to sort an array(asort) so that a word containing "-" is sorted correctly, for instanceA-listis after Alistwith only asort, A-list is always first!Thanks Quote Link to comment https://forums.phpfreaks.com/topic/20418-sorting-array-in-alpabetical-order-words-containg/ Share on other sites More sharing options...
ober Posted September 11, 2006 Share Posted September 11, 2006 That's because alphabetically, it is correct. - is before l in the sorting algorithm. Quote Link to comment https://forums.phpfreaks.com/topic/20418-sorting-array-in-alpabetical-order-words-containg/#findComment-89955 Share on other sites More sharing options...
IMakeLousyCode Posted September 11, 2006 Author Share Posted September 11, 2006 OK thanks, I will keep it this way then, if it even alphabetically correct! ;D Quote Link to comment https://forums.phpfreaks.com/topic/20418-sorting-array-in-alpabetical-order-words-containg/#findComment-89975 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.