php 中 实体进行转换的函数 html_entity_decode()
htmlentities(); html_entity_decode(); htmlspecialchars();
$a = '<div><p>11111#11</p></div> /s #1'; $b = htmlentities($a); echo 'htmlentities: '.$b; echo "<br>"; $c = html_entity_decode($b); echo 'html_entity_decode: '.$c; $d = htmlspecialchars($a); echo "htmlspecialchars: ".$d;
htmlentities: <div><p>11111#11</p></div> /s #1 html_entity_decode: 11111#11 /s #1 htmlspecialchars: <div><p>11111#11</p></div> /s #1

浙公网安备 33010602011771号