bergman
bergman

Reputation: 185

Wrong specialchar order with scandir

scandir sorts underline after numeric and other special chars: How can i sort directorys the expected way?

 $files = scandir($dir);

... sorts to:

/first
/first/,om
/first/0go_for_it
/first/1oho
/first/2ond
/first/_des
/first/_des/go
/first/_des/start
/first/_mh
/first/klassen
/first/wow

Upvotes: 0

Views: 52

Answers (1)

Marcin Nabiałek
Marcin Nabiałek

Reputation: 111869

You cannot do anything with it but you can sort the result using your own algorithm using uasort function

Upvotes: 1

Related Questions