PDA

View Full Version : sort array


FrEaKmAn
September 25th, 2007, 07:01 PM
Hi

Does anybody know if there are any problems with sorting an array if there are some non-standard symbols like č,š,ž? Because I'm have some strange things going on, it sorts one part from a to z and then for some reason it's starts again from a to z...

FrEaKmAn
September 25th, 2007, 07:18 PM
I found the problem, it was key sensitive, so running this function

A real quick way to do a case-insensitive sort of an array keyed by strings:

uksort($myArray, "strnatcasecmp");

solved the problem, but there are still problems with words starting with č,š,ž..