Convert special characters (another language) to English in PHP

Is there a function that imposes special characters on their English equivalents. E.g. Convert é to e. Etc ...

+5
source share
4 answers

The function you execute is iconv () - from user notes, it looks like what you want to do: transliteration characters

+6
source

You should use this one and it will work:

setlocale(LC_CTYPE, 'nl_BE.utf8');
$string = iconv('UTF-8', 'ASCII//TRANSLIT', $string);

I tested a lot of accented characters

+3
source

danp (iconv), strtr . script ( Google).

0

You can create a function containing an array of characters that you want to exchange and pass strings and just change ã this way if iconv () does not work for you.

0
source

All Articles