Regex to ignore accents? PHP

后端 未结 5 966
名媛妹妹
名媛妹妹 2020-12-06 10:50

Is there anyway to make a Regex that ignores accents?

For example:

preg_replace(\"/$word/i\", \"$word\", $str);

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-06 11:30

    Set an appropriate locale (such as fr_FR, for example) and use the strcoll function to compare a string ignoring accents.

提交回复
热议问题