Skip to content
Advertisement

php array sorting with accents

I am using this to sort according to last name:

JavaScript

But – when in last name is accent, e.g. Šiko, Áron, etc, these names are at the end. How can I sort it properly?

Advertisement

Answer

Use multi-byte string functions. There is a function called strcoll which seems to suit your needs.

More info:


EDIT: added Peter’s working code, below

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement