Skip to content
Advertisement

Is there any benefit in using PHP comments over HTML comments in HTML code? [closed]

I heard someone say that there is, so I was wondering.

HTML comment:

<!-- Comment goes here. -->

PHP comment:

<?php // Comment goes here. ?>

Advertisement

Answer

Unlike HTML comments, PHP comments don’t show up in the final output. That is often desirable, as comments are usually internal notes that are none of anybody’s business.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement