php中定义网站根目录的常用方法

复制代码 代码如下:

  define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/../')));