Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将 HTML 特殊字符(如“ ”)转换为 UTF-8 中的相应字符,如字符串中的“”(空格)。
有这样做的功能吗?
你可以使用这个功能:
html_entity_decode()
html_entity_decode — 将所有 HTML 实体转换为其适用的字符(包括 UTF-8)
http://php.net/manual/en/function.html-entity-decode.php