PHP 常量dirname(__file__)

PHP 常量dirname(__FILE__)取得当前文件的绝对路径。

1 define('ROOT_PATH', str_replace('includes/2.php', '', str_replace('\', '/', __FILE__)));
2 取得网站根目录
原文地址:https://www.cnblogs.com/tl542475736/p/3427818.html