In boucle for orden alphabetic with Ñ

Started by Jotade29, January 17, 2024, 05:46:55 PM

Previous topic - Next topic

Jotade29

My version: 2.0.19

Hi!!

I wud like to add to this alphabetical order the letter "ñ" which is a Spanish letter that is placed between "n" and "o". But ii can't think of how to do it. With the following code fragment it doesn't show me the "ñ"... Any ideas?

for ($i=ord("A");$i<=ord("Z");$i++)
    {
        if (!in_array(chr($i),$alfabeto_l) )
            $context['diccionario'] .= chr($i).' | ';
        else
            $context['diccionario'] .= '<b><a href="javascript:letra_diccionario(\''.chr($i).'\')">'.chr($i).'</a></b> | ';
    }

With this code, i see... A | B | C ... Z |, with or within link. I need see "(...) | N | Ñ | O | (...)".

tHXNXX!
Quote from: Diego Andrés on August 12, 2023, 02:20:18 AMI'm afraid convincing Jotade to upgrade to SMF 2.1 will require bigger effort than your work sanitizing Unicode characters  :laugh:

Advertisement: