在global.inc 里定义根目录
define( "APP_ROOT", dirname(__FILE__) );
在任何PHP文件中可以引用该常量
require_once( APP_ROOT . "/inc/head.php" );
------------------------------------------------------------
看不懂这几句话,dirname(_FILE_)输出时都是一个点.
require_once( APP_ROOT . "/inc/head.php" )
不是相当于
require_once( "./inc/head.php" )
这还是相对目录吧?
难道php没有ASP一样的server.mappath()?