I have some BBCode-like code for my forum:
[quote] opens a table, tr, td…
[/quote] closes the table, tr and td…
But when the user writes another [/quote] it adds another </td></tr></table>, and this closes the table the ‘forum body’ was in.
I know there is probably a simple solution, but what do I put it in so closing a table will not ‘break the layout’ so to speak?
Div? Span?
Or is it more complex?
Try preg_replace/regex:
This would match up to the first end-quote tag.