phdphd Posted July 14, 2019 Share Posted July 14, 2019 Hi All, I want to display lists of words (utf8 encoded) correctly ordered in Spanish, where "ch" and "ll" are considered as letters in the alphabet. For French, I use the following : $col = new Collator('fr_FR'); $col->setAttribute(Collator::FRENCH_COLLATION, Collator::ON); $col->asort(<array-to-sort>); What would be the equivalent for spanish? Thanks! Quote Link to comment Share on other sites More sharing options...
requinix Posted July 14, 2019 Share Posted July 14, 2019 What have you tried? It's not like the code is particularly cryptic... Quote Link to comment Share on other sites More sharing options...
phdphd Posted July 14, 2019 Author Share Posted July 14, 2019 Well, so far, I tried nothing, as for spanish lists of words. It is just that googling terms like "SPANISH_COLLATION" gives no result. For example, when properly ordered in Spanish, "lleno" would come after "lomo", and "chico" after "cosa", since the alphabet order in Spanish is "a, b, c, ch, d, ....k, l, ll, m, n, ...z" Quote Link to comment Share on other sites More sharing options...
requinix Posted July 14, 2019 Share Posted July 14, 2019 1 minute ago, phdphd said: Well, so far, I tried nothing, Well that doesn't sound good. If you want your code to change then you'll have to try something. 1 minute ago, phdphd said: as for spanish lists of words. It is just that googling terms like "SPANISH_COLLATION" gives no result. Why are you going to Google when PHP has perfectly good documentation online? Find out what FRENCH_COLLATION actually means and decide what to do with it. 1 minute ago, phdphd said: For example, when properly ordered in Spanish, "lleno" would come after "lomo", and "chico" after "cosa", since the alphabet order in Spanish is "a, b, c, ch, d, ....k, l, ll, m, n, ...z" That's nice but it doesn't help you find out what you have to do with your PHP code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.