You are here: Re: Sorting with french characters « PHP « IT news, forums, messages
Re: Sorting with french characters

Posted by Catalin Trifu on 09/28/33 11:19

Check the manual for sort www.php.net/sort -> SORT_LOCALE_STRING
You would have to pay attention to the current locale -> www.php.net/setlocale
before the actual sort.

hope this solves it,
Catalin


Mathieu Dumoulin wrote:
> I've got a little problem with the ksort and sort functions. When i fill
> this array's keys or the array's data and i sort it, i can't seem to
> get a correct sort order concerning accented french characters.
>
> For example:
>
> Emiss, Erick
> Morrison, Phillip
> Tatey, Peter
> Zachary, Martin
> Élement, Marc-André
>
> This is the kind of result i get from Ksort when i put these as keys.
> Notice the "Élement, Marc-André" at the end? Its supossed to be in the
> "E"s not at the end.
>
> So i'm wondering how i can make this work now. I can't afford to make a
> STR_REPLACE on all possible accents, i got over a thousand records from
> the database to parse in a fast way and there are at the very least 60
> different accents to replace from the A, E, I, O and U without
> forgetting we have acute, grave, trema, circonflex accents for each
> letter. :S
>
> My guess is there is something in the configuration of my dev server
> that must do this. Can anyone help me?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация