How can headers be used in PHP to control the output format of HTML content?
Headers in PHP can be used to control the output format of HTML content by specifying the Content-Type header. By setting the Content-Type header to "text/html", you can ensure that the browser interprets the output as HTML content. This is particularly useful when generating HTML content dynamically in PHP scripts.
<?php
header("Content-Type: text/html");
echo "<html><head><title>Sample Page</title></head><body><h1>Hello, World!</h1></body></html>";
?>