View Single Post
  #4 (permalink)  
Old 11-02-09, 04:11 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
parse_url() will give you a lot more than that. Did you care to read the documentation?

Aside from that, removing the www. subdomain is easy. The tricky part will be removing subdomains not part of the desired domain. You will indeed need to specify any top-level extensions you expect to be used... or just guess using the extension length, which wouldn't be entirely trustworthy if you plan on using shorter 2nd-level (cnn.com, go.com) or longer 1st-level (example.travel, example.museum).
__________________
The toxic ZCE

Last edited by Keith; 11-02-09 at 04:19 PM.
Reply With Quote