Jump to content

Archived

This topic is now archived and is closed to further replies.

bosniamaj

bbcode help

Recommended Posts

I have similiar problem to this:
http://www.phpfreaks.com/forums/index.php/topic,105904.0.html

But I want to make smothing like this:
[ quote=someone][ quote=someoneelse][ quote=me]hi there[/quote]hi to you too[/quote]hi all[/quote]

to be like this:
[quote]someone says:
[quote]someoneelse says:
[quote]me say:
hi there[/quote]hi to you too[/quote]hi all[/quote]

I will use this for quote:
[code]<div style='border: 1px solid #cccccc; margin: 5px 4px; padding: 2px; background-color: #e9e9e9; font-size: 11px;'>\\1 says: <br>\\2</div>[/code]

Share this post


Link to post
Share on other sites
Use the following as the reqaluar expression:
[code]|\[quote=(.*)\](.*)\[/quote\]\]|is[/code]

Share this post


Link to post
Share on other sites
[code=php:0]$yourvar = preg_replace("|\[quote=(.*)\](.*)\[/quote\]\]|is",
"<div style='border: 1px solid #cccccc; margin: 5px 4px; padding: 2px; background-color: #e9e9e9; font-size: 11px;'>\\1 says: <br>\\2</div>",
$yourvar);[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.