I have a site that uses ad banner rotators and I'm assigning them to different sections of a site depending on the current directory of the URL. BUT, if you're in the "root" of the site, meaning, the home page "www.somedomain.com" and there's no other directory, I want to assign it as such.
Right now, the only thing I can think of is this:
$SiteDirectory = explode('/',$url);
Which returns current directory after the last "/" of a URL.
But what if there's nothing after it? How do I identify if it is the root of the site?
This:
$Site = parse_url($url);
just gets me the domain, but if there's directories after it, it's useless to me.
And this:
$CurrentURL = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
gives me the the WHOLE thing....
So, how do I find out if it's the home directory?