开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜