URL pattern for wrapping links
Posted: Sat Nov 29, 2008 6:14 am
I'm looking for a pattern that can match URL addresses in order to wrap them with an anchor tag. Something like:
Where the pattern could match any simple URL address, with or without the protocol. Somehow I'd figured I could google my way to this, but have been failing miserably.
Code: Select all
preg_replace($pattern, '<a href="$1">$1</a>', $text);