I think, maybe, I am slightly grasping this concept.
I think I would somehow put this into a form where if they clicked the proper button, it would insert the proper bb text command:
$poster_message = str_replace('[ b]', '<b>', $poster_message);
$poster_message = str_replace('[ /b]', '</b>', $poster_message);
$poster_message = str_replace('[ i]', '<i>', $poster_message);
$poster_message = str_replace('[ /i]', '</i>', $poster_message);
$poster_message = str_replace('[ u]', '<u>', $poster_message);
$poster_message = str_replace('[ /u]', '</u>', $poster_message);
$poster_message = nl2br($poster_message);
But is there a way to make this button, and when the click it, it keeps the text that they have already entered into the textarea adds a [ i ] or whater and then when they click the button again, it inserts the [/ i ] without altering the text they already typed. Keep in mind that I have searched for some sort of code to pick apart and teach myself from, but have come up with nothing, so I am in the dark on this subject. Any help is always greatly appreciated. Thank you.