I am trying to create a custom sort. I realise that it will have to be a usort function, as none of the standard methods work.
abcd fgh
abcd0
abcd1
abcd2
abcd3
abcd10
abcd11
abcd22
abcdefgh
abcd'fgh
abcd-fgh
The above is the order that I need my sort to output. Please notice the following:
a/ the list may contain numerical, punctuation, or characters.
b/ in the order of sorting, a space comes first, then numerical, then letters, then punctuation.
c/ where there are numerical characters, they are sorted in numerical order.
A variety of programs, such as Lightroom, already sort in this order, but I need to emulate this is PHP.
I am hoping that someone may recognise the pattern, and so be able to help with a usort function to copy it.
Thanking you for your consideration.