gpt4 book ai didi

php - 如何对 html/php 网页进行反注释?

转载 作者:太空狗 更新时间:2023-10-29 16:50:54 27 4
gpt4 key购买 nike

一个疯狂的问题:

想象一个名为 somepage.php 的网页文件它在我的编辑器中包含一些 html php 内容,我看到:

<html><head></head><body>  
<?=$welcome . $essay . $thatsAllForNowFolks . $footer ?>

<!--
Blue
Ball
Bell
Blow
Bows
Bats
Beef
Bark
Bill
Boss

-->
</body></html>

当我浏览我的网站时,我会在最终结果中看到这些评论,而我只希望该评论仅出现在我的编辑器中以供我 secret 灵感之用,并且不希望全世界都知道我在想什么时'发展中,而且我将所有网站访问者的评论视为互联网速度的浪费 bandwitch。

如何在提供 html 时取消注释我的整个 html/php 文件?非常感谢想法、代码和建议。提前致谢...

最佳答案

可能最简单的解决方案是用 PHP 编写评论。这样他们就不会在源代码中发送给客户端。你可以这样做:

<html>

<?php
//A single comment

/*
Some more
comments
*/
?>

</html>

关于php - 如何对 html/php 网页进行反注释?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5340047/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com