pri*_*cst 10 php unicode tamil string-split
如何在字符串中拆分泰米尔语字符?
当我使用时preg_match_all('/./u', $str, $results),
我得到的字符是"த","ம","ி","ழ"和"்".
如何获得组合字符"த","மி"和"ழ்"?
rua*_*akh 13
我认为你应该能够使用该grapheme_extract函数迭代组合字符(技术上称为"字形集群").
或者,如果您更喜欢正则表达式方法,我认为您可以使用此方法:
preg_match_all('/\pL\pM*|./u', $str, $results)
Run Code Online (Sandbox Code Playgroud)
其中\pL表示Unicode"字母",\pM表示Unicode"标记".
(免责声明:我没有测试过这些方法.)
| 归档时间: |
|
| 查看次数: |
2039 次 |
| 最近记录: |