Forum Moderators: coopster
I currently upload users' articles to a database, and want to allow them to insert links without actually using html - presumably it's a relatively simple function but I haven't managed to come up with anything that works yet.
eg. [link]www.widgets.com[/link]
should go to
<a href="http://www.widgets.com">www.widgets.com</a>
I understand I could use preg_replace, or similar, to change [link] to <a href etc.>, but am stuck when it comes to 'extracting' the URL from the string, especially when there are multiple occurences within the string.
Any help would be great...
Thanks.