I use Xampp. Here is my directory:
\xampp
\htdocs
\myweb
index.php
\classes
autoloader.php
classname.php
And here is the URL:
http://localhost/myweb/classname/methodname/idNum?arg=val
And I want to get this part: (everything until index.php
layer)
http://localhost/myweb
How can I do that?
Note1: $_SERVER['HTTP_HOST']
doesn't return expected thing. It just returns localhost
.
Note2: I can get the whole of URL and then parse it by regex to grab expected result .. But I don't want to do that because sometimes myweb
folder goes away.