【发布时间】:2013-02-04 19:13:26
【问题描述】:
我正在尝试定义我的应用程序的绝对根路径和根 url。 我试过this,但我还不能理解。
我在root 文件夹中创建了config.inc.php,并在答案中添加了代码。
此外,我在root 中有文件index.php,其中包含config.inc.php,并且常量很好。但我在${ROOT}/example/file.php 中有另一个文件,其中还包含config.inc.php,但根 url 最后包含示例文件夹。
应用结构是:
config.inc.php
index.php
example/file.php
我怎样才能始终拥有我的应用程序的绝对根路径和根 url?
谢谢!
【问题讨论】:
标签: php