Hello,
I have a function that turns any link within a variable into an HTML clickable link but the link looks like a full link, what i would like this function to do is to take the name of the domain without the HTTP and www just the site name and make the Link be that name. So instead of my links looking like this: http://www.somesite.com i want them to look like this "somesite" and that would be a clickable link.
Or a better idea would be somehow grab the links page title and use that for the <a href = "urlhere"> Page Title/Site Title </>
function make_clickable($text)
{
$ret = ' ' . $text;
$ret = preg_replace("#(^|[\n ])([\w]+?://[\w]+[^ \"\n\r\t<]*)#ise", "'\\1<a href=\"\\2\" >\\2</a>'", $ret);
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#ise", "'\\1<a href=\"http://\\2\" >\\2</a>'", $ret);
$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_\.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);
$ret = substr($ret, 1);
return($ret);
}