I'm very new to regular expressions and can't really figure out how it works. I have tried this:
function change_email($email){
return preg_match('/^[\w]$/', $email);
}
But this only returns a boolean true or false, I want it to return everything BEFORE the @. Is this possible? I don't even think I use the right php function here..