I have a url something like this:
http://example.com/a/b/c.php
If I do a $_SERVER['HTTP_HOST']
, I get example.com
If I do a $_SERVER['REQUEST_URI']
, I get a/b/c.php
But I want output as example.com/a/
I am assuming I will have to use some regex, not exactly sure how.
Any suggestions are welcome. Thank you :)