< /p>
< /p>
Why do you need to add .
to have an effect?
< /p>
伊谢尔伦2017-05-16 13:04:35
/ is the root directory. Using is_dir() in php to judge always returns false
, but it is possible to read this directory, such as:
$dir=opendir("/");
while(($tem=readdir($dir))!==false){
echo $tem,"<br>";
}
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.
大家讲道理2017-05-16 13:04:35
./
Start from the current directory
/
is calculated from the root directory
習慣沉默2017-05-16 13:04:35
/
代表根目录 ,比如目录结构 /var/www/html
,当前目录是 html
下,那么输入 命令 cd /
,当前目录切换到 根目录
.
./
代表当前目录,当前处于 html
下,输入 cd ./
, the current directory remains unchanged.
../
代表父级目录,当前处于 html
下,输入 cd ../
,切换后的目录为 /var/www
.