Possible Duplicate:
Getting domain name without TLD
So I have a Web site I am trying to work on. In the URL there is info and I want to parse it out and use it to make a db call to mysql:
http://www.relevant-info.org/home.html
I want to take the Url put it into a string.
Then I want to only get 'relevant-info' out of the url.
$webaddress = $_SERVER["SERVER_NAME"];
$parts = parse_url($webaddress);
$url = substr($Parts, 4, -4);
^ i am using that and I got the ip address (it is a centos 5.8 lamp) on a VM i am testing this, so in short this seams to work good so far :)