How can the issue of HTML pages not being displayed correctly after downloading a file in Internet Explorer be addressed in PHP?

Issue: When downloading a file in Internet Explorer, HTML pages may not be displayed correctly due to the browser not recognizing the correct content type. This can be addressed by setting the appropriate content type header in the PHP script that handles the file download. PHP code snippet:

<?php
// Set the content type header to force the browser to treat the response as HTML
header('Content-Type: text/html');

// Output the HTML content
echo '<html><head><title>Downloaded HTML Page</title></head><body><h1>Hello, World!</h1></body></html>';
?>