【发布时间】:2016-02-26 18:52:16
【问题描述】:
我有一个位于www.example.com/folder/ 的file.php。
我希望该文件对位于www.example.com/include/ 的文件使用包含命令。
如果我简单地使用:
<?php include './include/footer.php';?>
它不起作用,因为它会尝试在file.php 所在的物理文件夹中搜索,而我需要它来引用我的域的根目录。
【问题讨论】:
-
使用第二个点遍历父目录:
<?php include '../include/footer.php';?>. -
那行得通,但我想这是考虑到我只想升一级,对吧?
标签: php include include-path php-include