thinkphp获取目录的方法
1.获取根目录 http://localhost/
下面两种方法效果一样
$_SERVER['REQUEST_SCHEME']."://".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['SCRIPT_NAME']))
rtrim(dirname($_SERVER['SCRIPT_NAME']), '\/\\')
1.获取根目录 http://localhost/
下面两种方法效果一样
$_SERVER['REQUEST_SCHEME']."://".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['SCRIPT_NAME']))
rtrim(dirname($_SERVER['SCRIPT_NAME']), '\/\\')