Home >Backend Development >PHP Tutorial >DIRECTORY_SEPARATOR can actually be used /well, windows also supports it
Path separator, on Linux it is ‘/’ and on Windows it is ‘‘, I use /
Path separator, on Linux it is ‘/’ and on Windows it is ‘‘, I use /
DIRECTORY_SEPARATOR is a predefined constant for path separator.
Determine its value based on the system your server is deployed on, or the system your PHP file is run on.
If it is a Linux system, its value is /
. If it is a Windows system, its value is .
The function of this constant is to ensure that in any system, the path you write can be accessed normally by that system.