当前位置: 代码迷 >> PHP >> 将html代码转换成字符串,怎么进行转义
  详细解决方案

将html代码转换成字符串,怎么进行转义

热度:81   发布时间:2016-04-29 01:10:17.0
将html代码转换成字符串,如何进行转义?
比如将<form action="xxx.php">xxx<input type="text" name="xxx" /><input type="submit" value="xxx"/></form>转成一串字符串,可以传递到某页面执行该代码。

------解决方案--------------------
探讨

我知道了 $str=html_entity_decode("<form action='xxx.php'>xxx<input type='text' name='xxx' /><input type='submit' value='xxx'/></form>");

------解决方案--------------------
html_specialchars转成实体就不会被当做html标签了。
  相关解决方案