Forum Moderators: coopster
I've already added support for [b] [/b] (for bold), but I haven't find an easy solution for:
[url]somesite[/url]
and possibly
[url]somesite[urlname]click here[/urlname][/url]
I've done some search's but the amount of results returned for url is huge. If anyone has a quick code snippet or a link to a site that show's how to do this that'd be great. Thanks :)
$Content = "This is a [link=http://www.example.com]link to my web site[/link]"; $Content = preg_replace("/\[link=\"(.*?)\"\](.*?)\[\/link\]/","<a href=\"$1\">$2</a>",$Content); print($Content) Result should be:
This is a <a href="http://www.example.com">link to my web site</a>
You should be able to replace link with url, I only changed it because the url tag is parsed in this message board.