In ThinkPHP 3.2, the single entry file: index.php is placed in the root directory of the website. This root directory is not the same as the hard disk root directory mentioned earlier.
Because it is a single entry, the "./" current directory in the controller is actually relative to index.php.
/ is the root directory. Using is_dir() in php to judge always returns false
, but it is possible to read this directory, such as:
Can read the root directory of all hard disks.
In ThinkPHP 3.2, the single entry file: index.php is placed in the root directory of the website. This root directory is not the same as the hard disk root directory mentioned earlier.
Because it is a single entry, the "./" current directory in the controller is actually relative to index.php.
./ self
../ parent
/ root directory
That’s how I remember
./
Start from the current directory/
is calculated from the root directory/
代表根目录 ,比如目录结构/var/www/html
,当前目录是html
下,那么输入 命令cd /
,当前目录切换到根目录
../
代表当前目录,当前处于html
下,输入cd ./
, the current directory remains unchanged.../
代表父级目录,当前处于html
下,输入cd ../
,切换后的目录为/var/www
.