Get the document root path in php $_SERVER['DOCUMENT_ROOT']
I ususally use this one if i am linking to files in the server document root folder rather than specifying ../directory/include.file.php i will use something like this:
$document_root = $_SERVER['DOCUMENT_ROOT'];
Then you can use it in a require or include statement, or just echo it if you want to see what it is.
include_once($document_root . "/inc/my.file.php");
or just use it inline
include_once($_SERVER['DOCUMENT_ROOT'] . "/inc/my.file.php");
the reason i would use this is so that in a large directory structure site you will always still be referring to the document root. ;)