When I read text from a database, I want to automatically convert all urls into hyperlinks. Here is how far I've gotten:
$text = "Click on http://www.somedomainname.com/ for details";
$srchTerm="http://";
$srchTerm2="www";
if (!is_int(strpos($text,$srchTerm) || strpos($text,$srchTerm2) ))
{
$text=str_replace("$text","<a href='$text'>$text</a>",$text);
}
The above will convert the whole $text, rather than just the url.
How do I single out a url and make it into a hyperlink within a bunch of text?
Thx.
Richie.