文件树;
- 引导.php
- 面板/index.php
- 面板/inc/start.php
- 面板/inc/functions.php
过程:
- 索引.php;需要'inc/start.php'
- 开始.php;需要“../boot.php”和“functions.php”
- (require_once 'x.php' 使用)
调用 index.php 时一切正常。为什么我不必使用 ../../boot.php 而不是 ../boot.php?如果相对文件夹是 /panel,那么 require 'functions.php' 应该会失败。如果是 /panel/inc,require '../boot.php' 应该会失败。但一切都有效。如何?
注意:我知道我应该使用绝对文件夹来包含文件。我只是想了解这个例子是如何工作的。