What are the potential pitfalls of using the include function within an echo statement in PHP?

Using the include function within an echo statement in PHP can lead to unexpected results or errors. To avoid this, it is recommended to include the file before the echo statement and then echo the content of the included file separately.

<?php
include 'file.php';
echo $content;
?>