Jump to content

Archived

This topic is now archived and is closed to further replies.

IMakeLousyCode

Sorting array in alpabetical order, words containg "-"

Recommended Posts

Hi,
Is there an easy way to sort an array(asort) so that a word containing "-" is sorted correctly, for instance

A-list
is after Alist

with only asort, A-list is always first!

Thanks

Share this post


Link to post
Share on other sites
That's because alphabetically, it is correct.  - is before l in the sorting algorithm.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.