我在MySQL数据库中保存了一个文本
<p> Celebrate with these amazing<br /> offers direct from the
Run Code Online (Sandbox Code Playgroud)
现在,当我使用打印该文本时
echo
Run Code Online (Sandbox Code Playgroud)
我得到了这个输出
<p> Celebrate with these amazing<br /> offers direct from the
Run Code Online (Sandbox Code Playgroud)
但你想把它显示为
Celebrate with these amazing
offers direct from the
Run Code Online (Sandbox Code Playgroud)
喜欢HTML打印.
当我在db中看到它的存储时就像波纹管一样
<p>
Celebrate with these amazing<br />
offers from
Run Code Online (Sandbox Code Playgroud)
这该怎么做?
假设您的数据库已保存转义信息,如下所示:
<p>
Celebrate with these amazing<br />
offers from
Run Code Online (Sandbox Code Playgroud)
然后你可以使用PHP的html_entity_decode函数输出那个HTML块.
| 归档时间: |
|
| 查看次数: |
11115 次 |
| 最近记录: |