note 97628 added to function.str-replace
| From: | igor at taranets dot com | Date: | Thu, 29 Apr 2010 08:27:52 +0000 |
| Subject: | note 97628 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-168774@lists.php.net to get a copy of this message | ||
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;
}
----
Server IP: 69.147.83.197
Probable Submitter: 99.227.45.208
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- https://master.php.net/note/edit/97628
Del: integrated -- https://master.php.net/note/delete/97628/integrated
Del: useless -- https://master.php.net/note/delete/97628/useless
Del: bad code -- https://master.php.net/note/delete/97628/bad+code
Del: spam -- https://master.php.net/note/delete/97628/spam
Del: non-english -- https://master.php.net/note/delete/97628/non-english
Del: in docs -- https://master.php.net/note/delete/97628/in+docs
Del: other reasons-- https://master.php.net/note/delete/97628
Reject -- https://master.php.net/note/reject/97628
Search -- https://master.php.net/manage/user-notes.php