简体   繁体   English

有没有功能可以找到php中的绝对根路径?

[英]Is there a function to find the absolute root path in php?

for example: 例如:

/home/mydomain.co.uk/public_html/ /home/mydomain.co.uk/public_html/

Something generic for windows or linux? Windows或Linux通用吗? Id like it to produce the root path only regardless of where i call the script from. 我希望它只产生根路径,而不管我从哪里调用脚本。 So not the absolute root path to my script. 因此,不是我脚本的绝对根路径。

Sorry is this is hard to understand. 对不起,这很难理解。

$_SERVER['DOCUMENT_ROOT']; will work on both 将两者都工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM