Is there a function that coverts special characters to their english equivalents. For Eg. Convert é to e. Etc...
+2
A:
The function you are after is iconv() - from the user notes, this seems to be what you want to do: characters transliteration
danp
2010-03-02 09:09:20
When I used iconv('UTF-8', 'ISO-8859-1//TRANSLIT//IGNORE', $str); to convert João, it returened JooI would like it to return Joao...
castor
2010-03-02 09:13:57
Make sure the string is truly UTF-8. Encoding could be why it's not working as expected.
konforce
2010-03-02 09:18:59
Isn't there a script that changes everything (all type of formattings) to plain english. I can't get the code to work :(
castor
2010-03-02 09:27:26
`echo iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', "Jo\xc3\xa3o");` Note that I've hard coded the 'ã' as UTF-8 (0xc3a3) to ensure that the encoding is correct.
konforce
2010-03-02 19:03:14
A:
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.
Wilhelm Björklund
2010-03-02 10:16:26
A:
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
Tanuljjatszva
2010-04-28 12:07:17