get domain component from email
| From: | Kevin Waterson | Date: | Tue, 07 Aug 2007 18:25:05 +0000 |
| Subject: | get domain component from email | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-260298@lists.php.net to get a copy of this message | ||
Hi all.
Im looking for a way to get the domain from an email address.
Not sub domains, just the domain, so
luser@foo.bar.example.com.mn
would return
example.com.mn
similarly, the address luser@example.com would return
example.com
perhaps an array of tld's, then strip the tld off the end and anything
before that and the next "." is the domain?
also, somebody told me .co.uk was a tld, but I cannot see it listed
http://www.iana.org/root-whois/index.html
Kind regards
Kevin
--
"Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote."