Reputation: 61
Is there a function that coverts special characters to their english equivalents. For Eg. Convert é to e. Etc...
Upvotes: 6
Views: 14938
Reputation: 51
You should use this one and it will works:
setlocale(LC_CTYPE, 'nl_BE.utf8');
$string = iconv('UTF-8', 'ASCII//TRANSLIT', $string);
I've tested it a lot of accentuated characters
Upvotes: 5
Reputation: 1
You could make a function holding a array of chars you want exchanged and pass strings through and just change ã to a that way, if iconv() doesn´t work out for you.
Upvotes: 0
Reputation: 48284
If you don't like danp's solution (iconv), you could use strtr
with a list of conversions. This page has a sample script (first Google result).
Upvotes: 0
Reputation: 15241
The function you are after is iconv() - from the user notes, this seems to be what you want to do: characters transliteration
Upvotes: 7