Current Code I’m using to get email suffix
$emailarray = explode('@',$email_address);
$emailSuffix = $emailarray[1];
There’s gotta be a more efficient function. Maybe something using substr()?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Shorter:
But I don’t think it gets any significantly more efficient than that. Regex is probably slower.
EDIT
I did some testing and although this version was 3 times faster than using the
and
it doesn’t comply with the strict standards:
EDIT2
is about as fast as the end(explode(.)) method so I would suggest that one. Please see rayman86’s answer and comments.