Hi,
I've got this function to convert any urls into the proper links for my CMS. However, if I want to put in my own link <a href="http://www.domain.com">A link to domain.com</a> (rather than the basic url www.domain.com), this function really stuff's it up.
Is there a way to STOP the function from converting urls starting with '<a href=">'?
// Convert www into links
function convert_URLS($content) {
$content = eregi_replace("((ht|f)tp://www\.|www\.)([a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})((/|\?)[a-z0-9~#%&\\/'_\+=:\?\.-]*)*)", "http://www.\\3", $content);
$content = eregi_replace("((ht|f)tp://)((([a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3}))|(([0-9]{1,3}\.){3}([0-9]{1,3})))((/|\?)[a-z0-9~#%&'_\+=:\?\.-]*)*)", "<a href=\"\\0\" target=\"_blank\">\\0</a>", $content);
return $content;
}