我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

在浏览器上显示HTML实体

I'm trying to display a code of HTML entity on browser, but they do not show up it convert into their respective element on browser window in chrome and all browsers but i want to display the code of html element without converting using php echo function its possible or not please resolve.

Replace all the & into &. You can use htmlentities() function to do that:

echo htmlentities("<html>");    // &lt;html&gt;

Demo: IDEOne

If you wanna get &lt;html&gt;, then try doing it twice:

echo htmlentities(htmlentities("<html>"));

Demo: IDEOne

近期文章

  • 标题位置与会话用户名[重复]
  • 什么是关联数组? [关闭]
  • Laravel 5.1使用控制器作为路线
  • 如何在服务器外部访问代码外部的aws访问密钥
  • 如何链接我的网站中的图像以在另一页上的视频播放器中打开? [关闭]
  • PHP - 替换Array上的String
  • 我如何在PHP中创建一个字符串对象的数组?
  • 表中的表名称并在其中搜索
  • 如何在php中控制foreach循环迭代
  • 使用相同的键添加关联数组的元素
  • PHP读取数组[重复]
  • PHP7 / mysql PDO自定义功能
  • php条件(不同的值)
  • 解析错误:语法错误,意外T_VARIABLE,INSERT INTO,php [重复]
  • foreach PHP的问题
  • 如何将查询数据放在两个不同的数组中然后在两个表中回显?
  • symfony 2.8和twig:未定义的变量
  • php中的回合数取决于值
  • PHP For循环不产生输出
  • wordpress演示主题定制

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华