Forum Moderators: coopster
"h$tp://www.mydomain.com/index.htm h$tp://www.mydomain.com/happy.htm h$tp://www.mydomain.com/golucky.htm" Don't store HTML in your database, just keep the data as-is and add the links when you display it.
Sorry about the bug. Here's a fixed version:
$text="URL URL URL";
$links=explode(" ",$text);
$new=array();
foreach($links as $v){
$new[]="<a href='$v'>$v</a>";
}
print(implode(" ",$new));
inside the foreach loop you can also apply functions that verify the link as http or mailto, add the "www" or "http" if they're missing, append a "/" to a URL path with no file extension, etc etc.
[edited by: httpwebwitch at 8:17 pm (utc) on July 15, 2004]