Here's the email snippet:
$email = "abc@def.com";
$pos = strrpos($email, "@");
if (!$pos === false) {
// This is an email address!
$email .= "mailto:" . $email;
}
What exactly are you looking to do with the links? strip the www or http? or add http://www to any link if required?