htmlspecialchars_decode

把预定义的 HTML 实体 "<"(小于)和 ">"(大于)转换为字符:

<?php
$str = "This is some &lt;b&gt;bold&lt;/b&gt; text.";
echo htmlspecialchars_decode($str);
?>

上面代码的 HTML 输出如下(查看源代码):

<!DOCTYPE html>
<html>
<body>
This is some <b>bold</b> text.
</body>
</html>

上面代码的浏览器输出如下:

This is some bold text.
posted @ 2016-11-03 19:37  sun(阳光)  阅读(157)  评论(0编辑  收藏  举报