php is there a way to transfer Latin letters to english letters?

前端 未结 2 1248
滥情空心
滥情空心 2021-01-07 08:52

is there a way to transfer Latin letters to english letters with php?

Such as: āáǎà transfer to a,

ēéěè transfer to <

相关标签:
2条回答
  • 2021-01-07 09:47

    Have a look at How to change diacritic characters to non-diacritic ones

    0 讨论(0)
  • 2021-01-07 09:51

    iconv can usually do this for you:

    iconv("utf-8", "ascii//TRANSLIT//IGNORE", $string);
    

    Adjust source encoding to preference. The //TRANSLIT//IGNORE part tells iconv to transliterate (replace with "similar" characters) whatever it can and ignore (leave out or replace with "?", can't remember) what it can't.

    0 讨论(0)
提交回复
热议问题