How can the problem of including files in PHP scripts from different directories be addressed to ensure the correct file path is maintained?

When including files in PHP scripts from different directories, it's important to use the correct file path to ensure the files are included successfully. One way to address this is by using the `__DIR__` magic constant to get the absolute path of the current file and then construct the path to the included file relative to that.

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