Home  >  Article  >  Backend Development  >  将html代码转换成字符串,怎么进行转义

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

WBOY
WBOYOriginal
2016-06-13 10:24:181289browse

将html代码转换成字符串,如何进行转义?
比如将

xxx
转成一串字符串,可以传递到某页面执行该代码。

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

我知道了 $str=html_entity_decode("
xxx
");

------解决方案--------------------
html_specialchars转成实体就不会被当做html标签了。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn