Possible Duplicate:
Parsing Domain From URL In PHP
Basically I have a form where a user puts in a url of a page to save (e.g. http://domain.com/random/page) and I want it to just get the domain name of the website (domain.com). How do I do this?
Possible Duplicate:
Parsing Domain From URL In PHP
Basically I have a form where a user puts in a url of a page to save (e.g. http://domain.com/random/page) and I want it to just get the domain name of the website (domain.com). How do I do this?
I would remove the http://
and then split the string by /
. Take the first value of the resulting array from the split.