note 97628 deleted from function.str-replace by degeberg
| From: | degeberg@php.net | Date: | Thu, 29 Apr 2010 08:44:48 +0000 |
| Subject: | note 97628 deleted from function.str-replace by degeberg | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-168775@lists.php.net to get a copy of this message | ||
Note Submitter: igor at taranets dot com
Reason: bad code
----
function removeAccents($str)
{
//A simple function for normalizing
//accented characters to ASCII in a string.
$search = explode(",",
"Å ,Å,Ž,Å¡,Å,ž,Ÿ,Â¥,µ,
Ã,Ã,Ã,Ã,Ã,Ã
,Ã,Ã,Ã,Ã,Ã,Ã,
Ã,Ã,Ã,Ã,Ã,Ã,Ã,Ã,Ã,Ã,Ã,Ã,
Ã,Ã,Ã,Ã,Ã,Ã,à ,á,â,ã,ä,Ã¥,æ,
ç,è,é,ê,ë,ì,Ã,î,ï,ð,ñ,
ò,ó,ô,õ,ö,ø,ù,ú,û,ü,ý,ÿ"
);
$replace = explode(",",
"S,O,Z,s,o,z,Y,Y,u,
A,A,A,A,A,A,A,C,E,E,E,E,
I,I,I,I,D,N,O,O,O,O,O,O,
U,U,U,U,Y,s,a,a,a,a,a,a,a,
c,e,e,e,e,i,i,i,i,o,n,
o,o,o,o,o,o,u,u,u,u,y,y"
);
$result = str_replace($search, $replace, $str);
return $result;
}