I have a problem with changing urls to correct hyperlinks.
Right now I use this piece of code to change urls to links:
$text = ereg_replace("[[:alpha:]]+://[<>[:space:]]+[[:alnum:]/]","<a href=\"\0\" target=_blank>\0</a>", $text);
But sometimes the links are quite long so I would like to have a text, with the hyperlink behind it.
like this: <a href="http://www.somedomain.de" target="_blank">some other text</a>
In the text itself it should look like this [some other text|http://www.somedomain.de] ... it might have some other seperators... if its easier with others...
Has anyone a help for this thing??
Best wishes...