Home  >  Article  >  Backend Development  >  DIRECTORY_SEPARATOR can actually be used /well, windows also supports it

DIRECTORY_SEPARATOR can actually be used /well, windows also supports it

WBOY
WBOYOriginal
2016-08-29 08:50:581121browse

Path separator, on Linux it is ‘/’ and on Windows it is ‘‘, I use /

Reply content:

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn