$html_str = "Random Text™ First Second Third";
echo $str = html_entity_decode($html_str);
输出:Random Text™First Second Third
现在如何将$ str转换为$ html_str?
答案 0 :(得分:1)
根据文件: “html_entity_decode()与htmlentities()相反......” http://php.net/manual/en/function.html-entity-decode.php
“htmlentities - 将所有适用的字符转换为HTML实体” http://php.net/manual/en/function.htmlentities.php
您想使用htmlentities
$html_str = htmlentities($str);