How can relative paths be effectively used with include statements in PHP?

When using relative paths with include statements in PHP, it is important to understand the directory structure of your project. Relative paths are based on the current working directory of the script, so it's essential to navigate correctly to the file you want to include. To effectively use relative paths, you can use the `__DIR__` magic constant to reference the current directory of the file and construct the path from there.

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