How can the use of comments within HTML code affect the output in PHP?

When HTML comments are used within PHP code, they will be visible in the output to the user. To prevent this, PHP comments should be used instead. PHP comments are denoted by // for single-line comments and /* */ for multi-line comments.

<?php
// This is a PHP comment
echo "Hello, World!";
?>