ok i have a string which outputs: user@host.com how do i get it so i just have user...all help is appreciated
try:
$email = 'user@host.com'; list($user,$host) = explode('@',$email);
This splits the email address in half at the "@".
$str = "user@host"; print substr($str, 0, strpos($str, '@'));
Diego
<? $parts = explode('@',$email); echo $parts[0]; ?>