How can relative path issues be resolved when including files in PHP scripts?

Relative path issues can be resolved by using the `__DIR__` magic constant in PHP to get the absolute path of the current script's directory. This ensures that the included files are referenced correctly regardless of the script's location in the directory structure.

<?php
include __DIR__ . '/path/to/file.php';
?>