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

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

WBOY
Release: 2016-06-13 10:24:18
Original
1323 people have browsed it

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

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

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

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

------解决方案--------------------
html_specialchars转成实体就不会被当做html标签了。
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template