开发者

How to go to the "root" directory of a website?

开发者 https://www.devze.com 2023-03-31 05:47 出处:网络
There is a PHP website into a Linux computer webserver. In a particular PHP file , which is located in a deep subdirectory o开发者_开发百科f this site , I want to go to the first directory of the site

There is a PHP website into a Linux computer webserver. In a particular PHP file , which is located in a deep subdirectory o开发者_开发百科f this site , I want to go to the first directory of the site. How to write the PHP code to achieve that ?


$_SERVER['DOCUMENT_ROOT'] will respond the filesystem path to http://your_hostname/


Use $_SERVER['DOCUMENT_ROOT']

Documenation


$_SERVER['DOCUMENT_ROOT']

this will give the root directory.

0

精彩评论

暂无评论...
验证码 换一张
取 消