oops typo..it should be:

$message = preg_replace("/((http(s?):\/\/)|(www\.))([\S\.]+)/i",
'<a href="http\3://\4\5" target="_blank"
class="whitebglinkUN">\2\4\5</a>', $message);

sowwi., it looks like the person who put it in didnt work properally 4


----- Original Message -----
From: "Terry Romine" <[EMAIL PROTECTED]>
Sent: Friday, December 07, 2001 7:08 AM
Subject: [PHP-DB] finding a link in large text blob

> Is everyone ignoring me?? This is the third time I have asked for
> assistance on this...
> Is there an easy way (say using eregi_replace) to find a link reference
> in a blob of text and add the <a href> anchor around it? Something like:
> "text has a link to a website at
> http://www.whatever.com/mydirectory/mypage.html ..."
> and converts it to
> "text has a link to a website at <a
> href='http://www.whatever.com/mydirectory/mypage.html'>website</a> ..."
> My thoughts are that I should be able to do something like a
> eregi_replace, finding any occurances of http:// and trapping all
> non-space characters following it to convert to the anchor. But what
> about multiples? How do I rebuild the text with the substitute strings?
> Thanks in advance
> Terry

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to