Andy
Andy

Reputation: 3021

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

for example:

/home/mydomain.co.uk/public_html/

Something generic for windows or 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.

Upvotes: 0

Views: 156

Answers (1)

Adam Hopkinson
Adam Hopkinson

Reputation: 28795

$_SERVER['DOCUMENT_ROOT']; will work on both

Upvotes: 2

Related Questions