Hi
I found a nifty regex on the web that i have used to turn a url into an active url in the middle of a text string :
$str = preg_replace('/\b(https?|ftp|file|http)[:\/\/][-A-Za-z0-9+&@#\/%?=~_|!:,.;]*[-A-Za-z0-9+&@#\/%=~_|]/', '<a class=\"weblink\" href="\0">\0</a>', $str);
//
//
i was wondering if it anyone could think of a way to remove the "http://" from the link displayed in the text, so that the function would output
<a class="weblink" href="http://www.google.com">www.google.com</a>
instead of how it does at the moment :
<a class="weblink" href="http://www.google.com">http://www.google.com</a>
I would need to do something to the >\0<\a> but i can't find a way to do this
thanks for any ideas you may have on the subject