php – 不要将html存储为字符串(执行或处理html字符串)

栏目: PHP · 发布时间: 6年前

内容简介:翻译自:https://stackoverflow.com/questions/12693093/do-not-escape-html-stored-as-string-execute-or-process-html-string

在PHP(WordPress主题功能,尝试将主题选项中存储的html添加到博客标题中),

我想要获得以下内容:

$x="<p>html</p>"; echo $x;

要呈现html,就像:

echo "<p>html</p>";

结果不同,第一个将显示html标签,而第二个将处理html.

有人可以请帮助.

谢谢

使用单引号

Single quotes vs double quotes in PHP

echo '<p>HTML</p>';

翻译自:https://stackoverflow.com/questions/12693093/do-not-escape-html-stored-as-string-execute-or-process-html-string


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Algorithm Design Manual

The Algorithm Design Manual

Steven S Skiena / Springer / 2011-11-14 / GBP 55.07

....The most comprehensive guide to designing practical and efficient algorithms.... Written by a well-known algorithms researcher who received the IEEE Computer Science and Engineering Teaching Aw......一起来看看 《The Algorithm Design Manual》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具