Hi All
I am building a site which allows a user to search for domain names. My site has a textarea which allows a number of domains to be entered. As art of the form, the user can tick from a selection of TLD's.
What I need is a nice PHP function that checks each line from the textarea and removes everything excpet the domain name itself. I few examples below given. Where the text is bold, this would be removed by the function:
http://mydomain.com
http://www.mydomain.com
http://www.my-domain.co.uk
www.mydomain.org.uk
mydomain.it/dummy-url
Essentially if the users types htttp, www or any TLD and subsquent URL path, I need it all removed to only leave the domain name they are searching for.
I guess I want to make this form idiot proof any way I can!
Thanks for any help.
Doug