How can PHP be used to include a page from a different directory without encountering path errors?

When including a page from a different directory in PHP, it's important to use the correct path to avoid encountering errors. One way to ensure the inclusion works properly is to use the `__DIR__` magic constant in combination with the `dirname()` function to generate the absolute path to the included file.

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