The way I wrote it was like this:
1) User wrote news to be posted on the website and formatted it with any bbcode he or she wanted to use.
2) I stored the string in the database unformatted (i.e. it still had it's bbcode in the text, not it's HTML/CSS equivalent.).
3) When viewing news on the main page, I just ran tagformat($row['text']) (or whatever the field was called), and it formatted the text after pulling it from the database.
So, if the user needed to edit the content afterwards, I would just pull the bbcode formatted entry from the database and stick it into a textarea field. Then they could edit it from there and their changes would show up.
Hopefully that made sense. 😉