Switching the debate forum code on my website, I'm going to change the way quotes are stored in the database. Now I need to create a regex to reorder already sent messages in my database.
Below is an example of how my current discussion post is stored in a database (with quotation marks in quotation marks). Note. I did this to illustrate:
Just citing a post
[quote]Text of quote #3
[quote]Text of quote #2
[quote]Text of quote #1
[name]User 1[/name]
[/quote]
[name]User 2[/name]
[/quote]
[name]User 3[/name]
[/quote]
Now I would like the first one to be rebuilt to look like this:
Just citing a post
[quote:User 3]
Text of quote #3
[quote:User 2]
Text of quote #2
[quote:User 1]
Text of quote #1
[/quote]
[/quote]
[/quote]
Can any of you tell me how this can be done with regex? I am using PHP.
Thanks in advance, I appreciate all your help :)
Fisher
source
share