How can the use of dirname(__FILE__) help in resolving path issues in PHP includes?

When including files in PHP, the path to the included file can sometimes be incorrect due to differences in file structures on different servers. Using dirname(__FILE__) can help resolve this issue by providing the absolute path to the current file, allowing for more reliable includes.

<?php
include dirname(__FILE__) . '/path/to/include/file.php';
?>