What potential pitfalls can arise when using include/require with PHP files that contain both HTML and PHP code?

When using include/require with PHP files that contain both HTML and PHP code, potential pitfalls can arise if the HTML code is not properly enclosed within PHP tags. To avoid this issue, it is important to ensure that the PHP file being included only contains PHP code and no HTML code outside of PHP tags.

// Incorrect way to include a file with both HTML and PHP code
include 'file_with_html_and_php_code.php';

// Correct way to include a file with only PHP code
include 'file_with_only_php_code.php';