What are the differences between using include() and file_get_contents() for displaying file content in PHP, and how do they affect page loading?

When displaying file content in PHP, using include() is typically used for including and executing PHP files, while file_get_contents() is used for reading the content of a file as a string. include() will execute any PHP code within the included file, while file_get_contents() simply retrieves the content without executing any PHP code. In terms of page loading, include() can affect performance as it executes the code within the included file, while file_get_contents() is just reading the content without executing any code.

// Using file_get_contents() to display file content
$content = file_get_contents("file.txt");
echo $content;