Might be a trivial question, but I am looking for a way to say get the root of a site url, for example: http://localhost/some/folder/containing/something/here/or/there
should return http://localhost/
I know there is $_SERVER['DOCUMENT_ROOT']
but that's not what I want.
I am sure this is easy, but I have been reading: This post trying to figure out what i should use or call.
Ideas?
The other question I have, which is in relation to this one is - will what ever the answer be, work on sites like http://subsite.localhost/some/folder/containing/something/here/or/there
so my end result is http://subsite.localhost/