What are common pitfalls in including external PHP files and calling functions from them?

Common pitfalls in including external PHP files and calling functions from them include not properly including the file (resulting in a "file not found" error), not checking if the function exists before calling it, and potential naming conflicts if multiple files have functions with the same name. To avoid these issues, always use the correct file path when including external files, use function_exists() to check if a function exists before calling it, and consider using namespaces to prevent naming conflicts.

// Correct way to include an external PHP file and call a function from it
include 'external_file.php';

if (function_exists('external_function')) {
    external_function();
}