What are the best practices for including external files in PHP?

When including external files in PHP, it is important to follow best practices to ensure security and maintainability. One common approach is to use the `include` or `require` functions to pull in external PHP files. It is recommended to use `require` for files that are essential for the script to run, as it will halt execution if the file cannot be included. Additionally, it is good practice to use absolute paths or constants to include files to avoid path traversal vulnerabilities.

<?php
// Using require to include an essential external file
require '/path/to/external/file.php';

// Using include to include a non-essential external file
include '/path/to/external/non_essential_file.php';
?>