eregi_replace; recognize hyperlinks automatically
Hi there
I would like to convert webadresses in text from my database automatically into hml hyperlinks. The pattern for recognizing it is that it starts with "http" (or "www") and ends with any word-separator. I have googled the issue without finding anything that works for me. I tried this out:
PHP Code:
$text = eregi_replace(
'\\[http]([-_./a-z0-9!&%#?+,\'=:;@~]+)\\[\b]',
'<a href="\\1">\\1</a>', $text);
- as [\b] is supposed to be the regular expression for any word-separator. I tried a couple of other options too without success.
Can anyone see what's wrong?