I want to just get the left half of an email address ( the username part of username@email.com ), so stripping the @ and any characters after it.>
username
username@email.com
function subStrEmail($Useremail) { $emailSub=substr($Useremail,4); $email = explode('.', $emailSub); if($email[0]=='www'){ $email=substr($emailSub,4); $email=ltrim($email,'www.'); return $email; } return $emailSub; }