replace all accented characters from string with english characters or alphabets
by rajesh[ Edit ] 2010-01-03 13:36:02
Here is a function to replace all accented characters from string with non-accented English character or alphabets
function replaceAccentedCharacters($input)
{
$accent='ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËéèêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ';
$noaccent='AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNn';
$cleaned = strtr($input, $accent, $noaccent);
return $cleaned;
}
This will replace
À to A
Á to A
 to A
à to A
Ä to A
Å to A
à to a
á to a
â to a
ã to a
ä to a
å to a
Ò to O
Ó to O
Ô to O
Õ to O
Ö to O
Ø to O
ò to o
ó to o
ô to o
õ to o
ö to o
ø to o
È to E
É to E
Ê to E
Ë to E
é to e
è to e
ê to e
ë to e
Ç to C
ç to c
Ì to I
Í to I
Î to I
Ï to I
ì to i
í to i
î to i
ï to i
Ù to U
Ú to U
Û to U
Ü to U
ù to u
ú to u
û to u
ü to u
ÿ to y
Ñ to N
ñ to n
in the given string and return English string..