(PHP 4 >= 4.3.0, PHP 5, PHP 7)
html_entity_decode — 转换HTML相关实体字符
说明
html_entity_decode ( string $string [, int $flags = ENT_COMPAT | ENT_HTML401 [, string $encoding = ini_get("default_charset") ]] ) : string
范例
Example #1 解码 HTML 实体
<?php
$orig = "I'll \"walk\" the <b>dog</b> now";
$a = htmlentities($orig);
$b = html_entity_decode($a);
echo $a; // I'll "walk" the <b>dog</b> now
echo $b; // I'll "walk" the <b>dog</b> now
?> 自学教程
自学教程