html源代码编码

发布于 2024-08-29 18:33:06 字数 115 浏览 4 评论 0 原文

当我在我的 php 页面上查看源代码时,我得到了 " 的报价。但相反,我希望在源代码中使用 " 。我无法控制手动替换它,所以我想知道是否有一个函数可以做这样的事情。

when I view source on my php page I get " for a quote. But instead, I would like " to be used in the source code. I have no control over manually replacing it so Im wondering if there is a function to do such a thing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

似狗非友 2024-09-05 18:33:06

如果您有权访问 PHP 并希望将所有 html 特殊字符更改为其正确的变体,请使用:

print htmlspecialchars_decode($string);

If you have access to the PHP and want to change all html special characters to their rightful variations use:

print htmlspecialchars_decode($string);
入画浅相思 2024-09-05 18:33:06

您可以使用 str_replace 非常简单地完成此操作。

$string = str_replace('"', '"', $string);

不过,正如利威尔所说,为什么不就这样呢?它应该对显示没有影响。

You could do this very simply using str_replace.

$string = str_replace('"', '"', $string);

However, as Levi said, why not just leave it this way? It should have no effect on the display.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文