You might know the DOCUMENT_ROOT value of the $_SERVER array. This value indicates the absolute location of the site directory where pages are served. In short, it’s the public folder of site as defined in the server’s configuration. Here’s a quick example :
If you have a site in /home/me/site and can access it by http://site.dev, then the $_SERVER[‘DOCUMENT_ROOT’] is “/home/me/site”.
If any page in the server, even if it is in many sub folders, the DOCUMENT_ROOT value will be the same.
... [READ MORE]