Re: get domain component from email
| From: | Jim Lucas | Date: | Tue, 07 Aug 2007 21:13:23 +0000 |
| Subject: | Re: get domain component from email | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260331@lists.php.net to get a copy of this message | ||
Dan wrote:
Yup, that's pretty much what I wrote but with a bit more feedback for invalid addresses.not exactly
- Dan "Jim Lucas" <lists@cmsws.com> wrote in message news:46B8CC0C.9030909@cmsws.com...-- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William ShakespeareKevin Waterson wrote: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 KevinGive this a try http://www.cmsws.com/examples/php/domain_verification/example.php -- Jim Lucas "Some men are born to greatness, some achieve greatness,and some have greatness thrust upon them."Twelfth Night, Act II, Scene Vby William Shakespeare