What are the best practices for including external files in PHP, and how can absolute path references be implemented effectively?

When including external files in PHP, it is best practice to use relative paths to ensure portability and maintainability of the code. However, if absolute paths are necessary, they can be implemented effectively by using PHP's predefined constant __DIR__ to dynamically generate the absolute path.

// Example of including an external file using a relative path
include 'utils/functions.php';

// Example of including an external file using an absolute path
include __DIR__ . '/utils/functions.php';