Forum Moderators: coopster
$changed_content = preg_replace ( "/\[url=(.*?)\](.*?)\[\/url\]/i", "<a href=\\1 target=_blank>\\2</a>", $changed_content );
to transfer something like:
[url=www.site.com]Site[/url] into <a href=www.site.com target=_blank>\Site</a>
The thing is, i want to change it back from HTML into TAGS so when people eidt the content it is done easily.
Can anyone help me out with?
Is the replace code im using a good one for what im goin?
Or anyone know where i find the code o do what im trying?
Thanks again
The thing is, i want to change it back from HTML into TAGS so when people eidt the content it is done easily.
One way that you could do it is to store the bb-style tags in the database and only use preg_replace when actually displaying the news story. That way you won't have to convert back from HTML.
Elijah