html,php -Escape'<'和'>'符号回声
我想打印以下文本:
echo "<label> AAAAA";
但是它只是将“ AAAAA”显示为输出。
我怎么能逃脱'&lt;'和'&gt;'象征。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
使用 htmlspecialchars 。
Use htmlspecialchars.
corrence htmlspecialchars
refrence htmlspecialchars
使用
htmlentities()
纯文本字符串。
Use the
htmlentities()
function to convert into a plain text string.检查此 http://php.net/manual/manual/en/function.htmlentities.php ,这是代码 -
check this http://php.net/manual/en/function.htmlentities.php, and this is code -
您应该逃脱HTML的特殊字符。
echo“&amp; lt; label&amp; gt; aaaa”
You should escape your especial characters for HTML.
echo "<label> AAAA"
http://www.w3schools.com/tags/ref_entities.asp
使用HTML实体:
&amp; lt;
用于&lt;
and&amp; gt;
for&gt;
。可以使用htmlspecialchars
函数来实现: http://php.net/htmlspecialchars 。在此处阅读有关html实体的更多信息: http://www.santagata.us/characters/characterities/characterentities.html < /a>
Use HTML entities:
<
for<
and>
for>
. Could be achieved usinghtmlspecialchars
function: http://php.net/htmlspecialchars.Read more about HTML entities here: http://www.santagata.us/characters/CharacterEntities.html