【发布时间】:2019-01-09 13:44:18
【问题描述】:
我有一个字符串。
例如 -> "Pirate Code – PVP Battles at Sea Trailer"
我想用"Pirate Code – PVP Battles at Sea Trailer" str_replace
但它失败了。
实际上– 和– 都代表“-”。我想将– 转换为–
所以我可以执行该功能。
【问题讨论】:
-
请展示你到目前为止所做的尝试。
-
我试过 htmlentities($str);但它不会转换它们
-
要么
get_html_translation_table()你的出路,或者只是使用html_entity_decode()我猜? 3v4l.org/TeKVi
标签: php string html-entities