Try using regular expressions.
$string = preg_replace("/((http:\/\/|http:\/\/www|www)+.[\s]+)/i",'<a href="\1" target="new">\1</a>', $string);
This one will make a link clickable if it is in the following formats...
www.whatever.com
http://www.whatever.com
http://whatever.com
The above regex will turn those urls into
<a href="http://www.whatever.com">http://www.whatever.com</a>
The href will always get the http:// prepended, but the actual printed link will be whatever your link was in the string.