What does the dot-slash do to PHP include calls?

前端 未结 7 1491
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 09:05

A. What does this do?

require (\"./file.php\");

B. in comparison to this?

require (\"file.php\");

(

7条回答
  •  忘掉有多难
    2020-12-01 09:49

    Simply you are telling php to include the file in the current directory only or fail if the file is not present.

    If you use the format "indexcommon3.php" and the file is not present php will search it into the include_path system variable.

    For reference you can use http://www.php.net/manual/en/function.include.php

提交回复
热议问题