What is the best practice for generating readable HTML code using PHP echo commands?

When generating HTML code using PHP echo commands, it is important to maintain readability and structure for easier maintenance and debugging. One best practice is to break the HTML code into multiple lines and concatenate variables or strings using the dot (.) operator. Additionally, using indentation and proper spacing can greatly improve the readability of the generated HTML code.

<?php
// Example of generating readable HTML code using PHP echo commands
echo '<div>';
    echo '<h1>' . $title . '</h1>';
    echo '<p>' . $content . '</p>';
echo '</div>';
?>