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

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

内容简介:翻译自: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


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

查看所有标签

猜你喜欢:

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

Refactoring

Refactoring

Martin Fowler、Kent Beck、John Brant、William Opdyke、Don Roberts / Addison-Wesley Professional / 1999-7-8 / USD 64.99

Refactoring is about improving the design of existing code. It is the process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its int......一起来看看 《Refactoring》 这本书的介绍吧!

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

在线压缩/解压 CSS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具