Resolves the role of DIRECTORY_SEPARATOR and PATH_SEPARATOR constants in PHP

  • 2020-06-15 07:59:33
  • OfStack

One is DIRECTORY_SEPARATOR
DIRECTORY_SEPARATOR: Path separator, '/' on linux,' \' on windows

One is PATH_SEPARATOR
PATH_SEPARATOR: include USES multiple paths. Under windows, when you want include to use multiple paths, you use "; ". Separated, but used under linux as ":" separated.
The use of these two constants can avoid the compatibility problems of different platforms


Related articles: