PHP experts, please help! Email address parsing

hoihtah

Diamond Member
Jan 12, 2001
5,183
0
76
hi, i'm trying to parse email address with php.

say i have
$email="angrymod@anandtech.com"

how can i get that into
$email1="angrymod"
$email2="anandtech.com"

i'm a newbie... so please excuse the simplicity of this question. thanx in advance.
 

RedRooster

Diamond Member
Sep 14, 2000
6,596
0
76
Booyah!

So, something like $emailparts=split('@',$email); would give you an array called $emailparts, composed of two items. $emailparts[0]=angrymod and $emailparts[1]=anandtech.com