Page 1 of 1

Getting domain from email address

Posted: Thu Feb 12, 2004 9:11 am
by evilcoder
Hey guys, say someone puts there email into a form:

hello@world.com

How would i get PHP to skim the "hello@" off the input so i'm left with just:
world.com ??

thanks

Posted: Thu Feb 12, 2004 9:26 am
by penguinboy

Code: Select all

<?php
$email = 'hello@world.com';
$temp = explode('@',$email);
$domain = $temp['1'];
?>