本文介绍了替换全球变音符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用他的非变音符号兄弟代替变音符号。
示例:从guľôčka我想获得 gulocka
I want to replace diacritics characters with his non-diacritics brother.example: from "guľôčka" I wanna get "gulocka"
这里有一些本机函数吗?
Is here some native function to do it?
我正在寻找所有用str_replace替换的全球变音符号的列表。我找不到它。
I was looking for list of all worldwide diacritics characters for replace with str_replace. I can't find it.
非常感谢。
推荐答案
您可以通过使用 iconv
,,并请求通过音译进行编码转换。 (这实际上适用于许多不同的脚本!)如果只需要基本的欧洲字符,则将目标拉丁1或什至ASCII码作为目标。
You can achieve this by using iconv
, available in PHP, and requesting an encoding conversion with transliteration. (This actually works for many different scripts!) If you only want basic European characters, make the target Latin-1, or even ASCII.
从:
iconv("UTF-8", "ISO-8859-1//TRANSLIT", $text)
这篇关于替换全球变音符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!