开发者

php folder location

开发者 https://www.devze.com 2022-12-11 11:51 出处:网络
what is the difference between **./**folder-name/file.php and **../**folder-name/file.p开发者_StackOverflow中文版hp in php script?Path is interpreted by operation system you\'re using:

what is the difference between **./**folder-name/file.php and **../**folder-name/file.p开发者_StackOverflow中文版hp in php script?


Path is interpreted by operation system you're using:

  • ./ - usually means current folder
  • ../ - usually means parent folder

If you're in folder /home/user, then

  • ./folder-name/file.php will point to /home/user/folder-name/file.php
  • but ../folder-name/file.php will point to /home/folder-name/file.php, which is 1 level up


The first case, ./folder-name/file.php will start in your current directory.

The second case, ../folder-name/file.php will start from the parent directory.


../ is the directory below the directory you're currently in. ./ is the directory you're currently in. For example. If you are currently in /foo/bar. ../test.php is equivalent to /foo/test.php and ./test.php is equivalent to /foo/bar/test.php.

0

精彩评论

暂无评论...
验证码 换一张
取 消