A crazy question:
Imagine a webpage file called somepage.php
And it contains some html php contents in my editor I see:
<html><head></head><body>
<?=$welcome . $essay . $thatsAllForNowFolks . $footer ?>
<!--
Blue
Ball
Bell
Blow
Bows
Bats
Beef
Bark
Bill
Boss
-->
</body></html>
When I browse my site I see those comments in the final result, while I only want that comment to be only in my editor for my secretive inspirations and don't want the whole world to know what I'm thinking when I'm developing, as well as I see those comments for any and all my website visitors as wasted bandwitch of internet speed.
How do I decomment my entire html/php files at the moment the html is served? Ideas, code and suggestions are much appreciated. My thanks in advance...
Probably the easiest solution is to write your comments in PHP. This way they will not be sent to the client in the source code. You can do it like this:
<html>
<?php
//A single comment
/*
Some more
comments
*/
?>
</html>
Basically the same as Michiel's approach but I'm lazy so I would use the abbreviated tags, just be sure you have short_open_tag set to 1 in your php.ini config.
<html><head></head><body>
<?=$welcome . $essay . $thatsAllForNowFolks . $footer ?>
<? /*
Blue
Ball
Bell
Blow
Bows
Bats
Beef
Bark
Bill
Boss
*/ ?>
</body></html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With