What are some best practices for handling file paths and extensions when using the include function in PHP?

When using the include function in PHP, it is important to handle file paths and extensions correctly to ensure that the files are included properly. One best practice is to use the `__DIR__` magic constant to get the absolute path of the current directory and then concatenate it with the relative path of the file you want to include. Additionally, always include the file extension in the path to avoid any ambiguity.

// Using __DIR__ to get the absolute path of the current directory
include __DIR__ . '/path/to/file.php';