Hi
I am trying to convert all urls I find in a string(body) to links
this is what I have:
$body = preg_replace("~(([url]ftp://[/url])|([url]http://[/url])|(www))[^\]]*~", "<a href=\"\\0\" target=\"_blank\">\\0</a>",$body);
This only takes one link, but if I have several links in the string, how can I do it then?
I guess I first have to put all occurences of ([url]ftp://,[/url] [url]http://[/url] and www) into an array, count them and then doe the preg_replace, but have no clue right now how to do it. Can anyone help.
thanks in advance,
regards Thomas A