Get Name from Email Address

This is post is now quite old and the the information it contains may be out of date or innacurate.

If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub

Check out this simple and easy function for extracting the name from an email address. It’s not very advanced but it is quite handy. Of course it could be used for similar applications by simply changing the character to split on.

function email_name($email_address, $split='@'){
	return ucwords(strtolower(substr($email_address, 0, strripos($email_address, $split))));
}

There are some very powerful things you can do with PHP and email. Check out this POP3 email class for some ideas. I am just starting to scratch the surface of this functionality and will doubtless have some more great things to show soon.


Tags: edmondscommerce