0

I have a file which is in project folder my wampserver www directory and I want to create a path to this file in my PHP script. I am not sure what is right in accomplishing this as I have seen the use of "./", "../" and the full root directory of "c:/...." I foresee a situation where the use of C: would restrict the usage of the path to only that local machine and I therefore want to use the wamp's root which is www.

hakre
  • 193,403
  • 52
  • 435
  • 836
ibiangalex
  • 375
  • 1
  • 4
  • 16

1 Answers1

0

To get the document root just read it from the $_SERVER-superglobal.

echo $_SERVER['DOCUMENT_ROOT'];
KingCrunch
  • 128,817
  • 21
  • 151
  • 173