What are some alternative methods to including files in PHP that can help avoid issues with directory paths?

When including files in PHP, using relative paths can sometimes lead to issues with directory structures, especially when moving files around. To avoid these problems, one alternative method is to use the `__DIR__` magic constant which represents the directory of the current file. This way, you can include files using absolute paths regardless of the file's location.

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