What are the best practices for integrating static HTML content into dynamic PHP files to optimize performance and maintainability?

When integrating static HTML content into dynamic PHP files, it is important to separate the static content from the dynamic PHP code to optimize performance and maintainability. One way to achieve this is by using PHP's output buffering functions to capture the static HTML content and then output it at the appropriate place within the dynamic PHP file.

<?php
ob_start();
?>
<!DOCTYPE html>
<html>
<head>
    <title>Static HTML Content</title>
</head>
<body>
    <h1>Welcome to my website!</h1>
</body>
</html>
<?php
$html_content = ob_get_clean();

// Dynamic PHP code here
echo $html_content;
?>