What are best practices for defining and using file paths in PHP applications?

When defining file paths in PHP applications, it is best practice to use the `DIRECTORY_SEPARATOR` constant to ensure cross-platform compatibility. Additionally, it is recommended to use the `__DIR__` magic constant to reference the current directory and build paths relative to it. This helps in creating more maintainable and portable code.

// Define file path using DIRECTORY_SEPARATOR and __DIR__ magic constant
$filePath = __DIR__ . DIRECTORY_SEPARATOR . 'folder' . DIRECTORY_SEPARATOR . 'file.txt';