How can the issue of including a file in multiple locations be resolved without using absolute paths in PHP?

When including a file in multiple locations in PHP without using absolute paths, you can use the `__DIR__` magic constant combined with relative paths to ensure the file is included correctly. This constant represents the directory of the current file, allowing you to create a reliable path to the included file regardless of the location from which the include statement is called.

include __DIR__ . '/path/to/file.php';