html源代码编码
当我在我的 php 页面上查看源代码时,我得到了 "
的报价。但相反,我希望在源代码中使用 "
。我无法控制手动替换它,所以我想知道是否有一个函数可以做这样的事情。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
当我在我的 php 页面上查看源代码时,我得到了 "
的报价。但相反,我希望在源代码中使用 "
。我无法控制手动替换它,所以我想知道是否有一个函数可以做这样的事情。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
如果您有权访问 PHP 并希望将所有 html 特殊字符更改为其正确的变体,请使用:
If you have access to the PHP and want to change all html special characters to their rightful variations use:
您可以使用
str_replace
非常简单地完成此操作。不过,正如利威尔所说,为什么不就这样呢?它应该对显示没有影响。
You could do this very simply using
str_replace
.However, as Levi said, why not just leave it this way? It should have no effect on the display.