What is the correct way to include a text file within an HTML page using PHP?

To include a text file within an HTML page using PHP, you can use the `file_get_contents()` function to read the contents of the text file and then echo it within the HTML page. This allows you to display the text file content directly within the HTML output.

<?php
$text_file = 'example.txt';
$text_content = file_get_contents($text_file);
echo $text_content;
?>