this you mark!! that is exactly what i was looking for!! you have saved me a lot of hassle.
here is an altered version of marks script which will make links clickable and also truncate any long links. this version works with data entered over multiple lines.
$message=$the-string-which-covers-multiple-lines;
$message_array= explode("<br>", $message); //i used <br> but you could use \n
for($loop=0; $loop < count($message_array); $loop++)
{
$curtext = $message_array[$loop];
$message_array2= explode(" ", $curtext);
for($loop2=0; $loop2 < count($message_array2); $loop2++)
{
$curtext2 = $message_array2[$loop2];
if ( (ereg(".com",$curtext2 ))||(ereg(".net",$curtext2 ))||(ereg(".biz",$curtext2 ))||(ereg(".info",$curtext2 ))||(ereg(".org",$curtext2 ))||(ereg(".co.uk",$curtext2 ))||(ereg(".cc",$curtext2 ))||(ereg(".ws",$curtext2 )) )
{ //add any other you want - there's also a better way to find out if it's a URL
$curtext2= eregi_replace("http://", "", $curtext2);
if (strlen($curtext2)>70)
$curtext2 = "<a href ='http://$curtext2'>http://".substr($curtext2,0,70)."...</a>";
else
$curtext2 = "<a href ='http://$curtext2'>http://".$curtext2."</a>";
$message_array2[$loop2] = $curtext2;
}
}
$message_array[$loop]= implode(" ", $message_array2);
}
$message_formatted= implode("<br>", $message_array);