What role does the __DIR__ constant play in dynamically building absolute paths for file inclusion in PHP?
When dynamically building absolute paths for file inclusion in PHP, the __DIR__ constant can be used to reference the current directory of the script. This ensures that the path is always relative to the current script location, making it more flexible and portable.
// Dynamically include a file using __DIR__
include __DIR__ . '/path/to/file.php';