如何解码HTML&amp;到&amp;不允许在PHP中运行<script>块?

时间:2015-08-06 18:36:54

标签: javascript php html

目前在PHP中使用以下代码。

&#xA;&#xA;
  echo html_entity_decode($ productName); &#xA;  
&#xA;&#xA;

但是,如果此值类似于&lt; script&gt; alert(“Alert!”)&lt; / script&gt; ,这个脚本最终也会被执行。我想解码HTML而不允许运行脚本。

&#xA;

0 个答案:

没有答案