Directory_separator is the internal constant of PHP, which is used to display the system delimiter commands without any definition or inclusion.
The path delimiter in Windows is/(of course, it works on some systems), the delimiter on Linux is/, which leads to a problem, such as the development machine is windows, there is a picture upload program, the debug machine on the specified upload file save directory is:
Define (' ROOT ', DirName (__file__). " /upload ");
Debugging on-premises is normal, but when uploading to a Linux server, you will see an error. So PHP introduced the directory_separator variable, you can rewrite the above syntax:
Define (' ROOT ', DirName (__file__). Directory_separator. " Upload ");
Directory_separator is a PHP built-in command that returns the path delimiter associated with the operating system, returning on Windows/, and returning on Linux or Unix--that's the difference, This is usually used when you define a file path or upload a directory to save it.