Is there a possibility to replace alt-code-characters with "" in PHP?
Example input: Hell©ó
Output should be: Hello
I've tried preg_replace("/[^A-Za-z]+/i", "", $string);
Edit:
The problem is that I have to iconv the string before because I need letters like "á" to be replaced with alphanumeric ones, they should not just be deleted because I need to compare the string later. preg_replace would change "Ke©álo" to "Kelo". I need it to put out "Kealo".
This can be achieved using 2 seperate functions.
strtr()
first, thenpreg_replace()
followingstrtr()
in that order while using your presentpreg_replace("/[^A-Za-z]+/i", "", $string);
code.Sidenote: You can later add to the array if needed.
'é'=>'e'
as an example.You must need to add u (unicode) modifier.