Hello,
I am learning PHP5. I need to obtain my website's root directory in .php
code. I tried the code:
echo __DIR__, $_SERVER['DOCUMENT_ROOT'];
but it displays:
__DIR__/var/www/html
although my_website is installed in user's
directory: /home/robert/public_html/my_website.
I don't know why and how to obtain root directory.
Please help.
Thanks!
I am learning PHP5. I need to obtain my website's root directory in .php
code. I tried the code:
echo __DIR__, $_SERVER['DOCUMENT_ROOT'];
but it displays:
__DIR__/var/www/html
although my_website is installed in user's
directory: /home/robert/public_html/my_website.
I don't know why and how to obtain root directory.
Please help.
Thanks!
Comment