Replace foreign characters

后端 未结 4 1145
时光说笑
时光说笑 2021-01-04 23:59

I need to be able to replace some common foreign characters with English equivalents before I store values into my db.

For example: æ replace with <

4条回答
  •  轮回少年
    2021-01-05 00:43

    You can try iconv() with ASCII//TRANSLIT:

    $text = iconv("UTF-8", "ASCII//TRANSLIT", $text);
    

提交回复
热议问题