- LSaddon :: suppan : Correction de la méthode replaceAccents()

This commit is contained in:
Benjamin Renard 2008-10-06 15:18:17 +00:00
parent 172abab8a7
commit f8b0a443db
2 changed files with 55 additions and 4 deletions

View file

@ -24,6 +24,7 @@ $GLOBALS['LSaddons']['loads'] = array (
'samba', 'samba',
'posix', 'posix',
'ftp', 'ftp',
'supann',
'maildir' 'maildir'
); );

View file

@ -131,9 +131,59 @@
* @retval string La chaine sans les accents * @retval string La chaine sans les accents
*/ */
function replaceAccents($string){ function replaceAccents($string){
return strtr($string, 'àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ', $replaceAccent = Array(
'aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY'); "à" => "a",
"á" => "a",
"â" => "a",
"ã" => "a",
"ä" => "a",
"ç" => "c",
"è" => "e",
"é" => "e",
"ê" => "e",
"ë" => "e",
"ì" => "i",
"í" => "i",
"î" => "i",
"ï" => "i",
"ñ" => "n",
"ò" => "o",
"ó" => "o",
"ô" => "o",
"õ" => "o",
"ö" => "o",
"ù" => "u",
"ú" => "u",
"û" => "u",
"ü" => "u",
"ý" => "y",
"ÿ" => "y",
"À" => "A",
"Á" => "A",
"Â" => "A",
"Ã" => "A",
"Ä" => "A",
"Ç" => "C",
"È" => "E",
"É" => "E",
"Ê" => "E",
"Ë" => "E",
"Ì" => "I",
"Í" => "I",
"Î" => "I",
"Ï" => "I",
"Ñ" => "N",
"Ò" => "O",
"Ó" => "O",
"Ô" => "O",
"Õ" => "O",
"Ö" => "O",
"Ù" => "U",
"Ú" => "U",
"Û" => "U",
"Ü" => "U",
"Ý" => "Y"
);
return strtr($string, $replaceAccent);
} }
?> ?>