I am using XAMPP on Windows Vista. In my development, I have http://127.0.0.1/test_website/
.
How do I get http://127.0.0.1/test_website/
with PHP?
I tried something like these, but none of them worked.
echo dirname(__FILE__)
or
echo basename(__FILE__);
etc.
I had the same question as the OP, but maybe a different requirement. I created this function...
...which, incidentally, I use to help create absolute URLs that should be used for redirecting.
and you get something like
Try this. It works for me.
Use like this:
Just test and get the result.
Usage: