What are the limitations of using headers like "Content-type: text/txt" to indicate that the output is not HTML when using PHP?

When using headers like "Content-type: text/txt" to indicate that the output is not HTML in PHP, there is a risk that the browser may still interpret the content as HTML due to its default behavior. To ensure that the content is properly displayed as plain text, it is recommended to also include the "Content-Disposition" header with a value of "attachment" to prompt the browser to download the content as a file instead of displaying it in the browser window.

<?php
header('Content-type: text/txt');
header('Content-Disposition: attachment; filename="output.txt"');

// Your plain text content here
echo "This is plain text content.";
?>