|
Posted by ZeldorBlat on 01/04/07 14:49
schwooba@gmail.com wrote:
> Is there a simple way to remove the last part of an email address using
> PHP. I want to remove the @ symbol and everything to the right of it.
> Any ideas?
>
> Example:
>
> thomas@xyz.com
>
> should be:
>
> thomas
>
> Thanks!
Someone here will inevitably suggest a regex, but that's overkill:
$email = 'foo@bar.com';
$username = substr($email, 0, strpos($email, '@'));
Navigation:
[Reply to this message]
|