My Add articles section allow user to formatted input or insert picture

such as when type

[Bold] Hello [/Bold] result is Hello
[Under] Hello again [/Under] result is Hello again

and when user want to add image in articles, First, user upload image to temp folder in server and I use PHP to generate code and user can push code where he want to add picture such as


user can post many image and can formatted font

PHP Code:
BoldHello world [/Bold]
PHP is a server-sidecross-platformHTML embedded scripting language
User type this code in textarea and I keep in single variable $articles and I keey value of $articles in database as Text, the problem is I want also keep all image that user add in database, but I don't how to take each picture name that in $articles.

Can anyone help me?
Is right way to keep all image file in to array and add to database later?