What are common pitfalls when combining HTML and PHP in a single document?

One common pitfall when combining HTML and PHP in a single document is forgetting to properly close PHP tags when switching between PHP and HTML code. To avoid this issue, make sure to always close PHP tags before entering HTML code and reopen them when returning to PHP code.

<?php
// PHP code here

?>

<!-- HTML code here -->

<?php
// More PHP code here
?>