What are best practices for specifying file paths when using include() in PHP?

When using include() in PHP, it's important to specify file paths correctly to ensure that the included files are found and included properly. One common best practice is to use absolute file paths instead of relative paths to avoid any issues with file path resolution. Another best practice is to use the magic constant __DIR__ to get the directory of the current file and build the path from there.

// Using absolute file paths
include('/path/to/include-file.php');

// Using __DIR__ to build file path
include(__DIR__ . '/include-file.php');