What are the best practices for including external files in PHP to ensure they are properly integrated into the HTML output?

When including external files in PHP to integrate them into the HTML output, it is important to use the correct file path and include them in the appropriate location within the HTML code. To ensure proper integration, it is recommended to use PHP's include or require functions to include the external files.

<?php
// Include external file using require_once
require_once('path/to/external/file.php');
?>