What are the potential pitfalls of using echo with include in PHP?

Using echo with include in PHP can lead to unexpected output or errors if the included file contains PHP code that generates output. To avoid this issue, it is recommended to use require instead of include, as require will throw a fatal error if the file cannot be included. This ensures that the script will not continue running if the included file is not found or if there are any errors in the included file.

<?php
require 'file.php';
?>