What’s the best way in PHP to convert characters with accents into the same characters without accents? Example: “Gekitō” to “Gekito”?:
iconv(‘utf-8’, ‘ASCII//TRANSLIT’, ‘Naruto: Gekitō Ninja ‘);
//TRANSLIT tells iconv to transliterate characters, or convert characters in the origin encoding to the closest possible matching character in the target encoding. This may be necessary when converting from something like UTF-8 (which supports the full range of Unicode characters) to ASCII (which only supports a very limited character repertoire). Ordinarily, iconv would exit and not complete the conversion. The use of //TRANSLIT tells iconv to use the closest possible character. If no such character is available, it will be replaced with the ‘replacement character’, which is often a question mark.