-
Bbcode Help
okay i have sum BBCODE most works fine...
PHP Code:
$replace = array ('/(\[[Bb]\])(.+)(\[\/[Bb]\])/',
'/(\[url=)(.+)(\])(.+)(\[\/url\])/',
'/(\[[CODE]\])(.+)(\[\/[CODE]\])/',
'/(\[FONT=)(.+)(\])(.+)(\[\/FONT\])/',
'/(\[[Uu]\])(.+)(\[\/[Uu]\])/',
'/(\[[marquee]\])(.+)(\[\/[marquee]\])/'
);
PHP Code:
$replacements = array ('<b>\\2</b>',
'<a href="\\2" target="_blank">\\4</a>',
'<table width=80% class="CDCode">
<tr>
<td.><div align=left class=style1>Code:</div></td>
</tr>
<tr>
<td><font color=orange>\\2</font></td>
</tr>
</table>',
'<font color="\\2">\\4</font>',
'<U>\\2</U>',
'<marquee>\\2</marquee>',
);
For some reason, anythin with more then 1 letter dont work... with the exeption of the ones with (=) in it. plz help....
-
Re: Bbcode Help
have u tried,
PHP Code:
$replace = array ('/(\[[Bb]\])(.*?)(\[\/[Bb]\])/',
'/(\[url=)(.*?)(\])(.*?)(\[\/url\])/',
'/(\[[CODE]\])(.*?)(\[\/[CODE]\])/',
'/(\[FONT=)(.*?)(\])(.*?)(\[\/FONT\])/',
'/(\[[Uu]\])(.*?)(\[\/[Uu]\])/',
'/(\[[marquee]\])(.*?)(\[\/[marquee]\])/'
);
Im not 100% sure if that will fix your problem but it works for me.
The pattern syntax is here if you didnt know:
http://uk2.php.net/manual/en/referen...ern.syntax.php