echo $_SERVER['DOCUMENT_ROOT'];
to get absolute path of root.
I had a problem to get absolute path when I put my code inside virtual/alias directory. when I use echo $_SERVER['DOCUMENT_ROOT']; , it will return absolute path for document root. Not my virtual directory.
How ever, here is the solution for my problem.
echo realpath('./');
0 comments:
Post a Comment