I´m using strcmp
in combination with usort
in order to sort an array of country names. Currently, the sort order is:
Belgien
Frankreich
Italien
Luxemburg
Niederlande
Spanien
United Kingdom
Österreich
Which is correct, apart from the position of Österreich
. It should be between Niederlande
and Spanien
.
I also tried strnatcmp
and strcoll
(with setlocale
), but the sort order was not the way I wanted it. The results are not from a mysql db, so sorting via a mysql query is not an option.