日期:2014-05-17  浏览次数:20469 次

将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标签了。