Ah okay.
Assuming you get email and url from db as :
$email(minus mailto🙂 and $url (minus http://)
then here is your NEW string....
$mystring = "The quick brown fox has a web page at <a href = \"http://$url\">$url</a>. You can email him at <a href = \"mailto:$email\">$email</a>.";
Remove the http:// and mailto: if those are stored in your database (be easier on your db if they weren't).