Replacing accented characters by non-accented characters
| From: | Yannick Warnier | Date: | Mon, 12 May 2008 15:09:48 +0000 |
| Subject: | Replacing accented characters by non-accented characters | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-274187@lists.php.net to get a copy of this message | ||
Hello,
I've been trying to find something nice to transform an accentuated
string into a non-accentuated string. Obviously, I'm mostly playing
inside the European languages, but any method that could transform
arabic or asian characters to plain non-accentuated characters would be
perfect.
I have found a number of solutions, ranging from str_replace() for every
known accentuated character to strtr() to a preg_replace() of a
conversion of the string to html characters then removing the "&" and
the "alteration" string (acute, grave, circ, ...).
I must say the last one seems to work better because it's less affected
by charset changes, but it still seems awfully slow to me and I would
like to know if there is any function that exists that could do that for
me?
Yannick