The problem of PHP creating directory function

When the

mkdir () function uses the absolute path, why is not taking the project directory as the root directory but disk as the root directory?

-sharp  E  Test 
mkdir("/Test");
-sharp  Test 
mkdir("Test");

solve

Php
Mar.01,2021

first of all, you don't know what absolute path
absolute path starts from the root path

    On
  • linux, it is / , for example: / home/salamander/code/test.js
  • In the case of
  • Windows Mountain, it starts with a drive letter, C:\ Windows\ System32\ drivers\ etc\ hosts

clipboard.png

Menu