$_SERVER[\'DOCUMENT_ROOT\']
returns
/usr/local/apache/htdocs/
is there a way to get
/home/us
You can also use dirname in dirname to get to where you want to be.
Example of usage:
For Joomla, modules will always be installed in /public_html/modules/mod_modulename/
So, from within a file within the module's folder, to get to the Joomla install-root on any server , I could use:
$path = dirname(dirname(dirname(__FILE__)));
The same goes for Wordpress, where plugins are always in wp-content/plugins/
Hope this helps someone.