使用函数htmlspecialchars_decode — 将特殊的 HTML 实体转换回普通字符,和 htmlspecialchars 刚好相反。
<?php
$str = "<p>this -> "</p>\n";
echo htmlspecialchars_decode($str);
$str2 = "http://coupon.jd.com/ilink/couponSendFront/send_index.action?key=af16a774f51b4ad28e19e2fe3628fa38&roleId=21722325&to=mall.jd.com/index-736105.html";
echo htmlspecialchars_decode($str2);
?>

本文介绍了如何使用PHP函数htmlspecialchars_decode将HTML特殊实体转换回普通字符,通过实例演示了该函数的用法,包括处理HTML文本和URL字符串。
363

被折叠的 条评论
为什么被折叠?



