What potential issues can arise when working with file directories in PHP scripts?

One potential issue when working with file directories in PHP scripts is handling file paths correctly, especially when dealing with different operating systems that have different directory separators. To solve this issue, you can use the `DIRECTORY_SEPARATOR` constant provided by PHP, which represents the correct directory separator for the current operating system.

// Example of handling file paths using DIRECTORY_SEPARATOR
$filePath = 'path' . DIRECTORY_SEPARATOR . 'to' . DIRECTORY_SEPARATOR . 'file.txt';
echo $filePath;