Just thought I would ask why not use something like this
<?php
if (isset($_POST['usercontent'])) {
$usercontent = $_POST['usercontent'];
$style = 'block';
}
else{
$usercontent = '';
$style = 'none';
}
?>
<div id="user_content" style="display: <?php echo $style; ?>;">
<?php echo $usercontent; ?>
</div>
Now there may be cases that may not work for you but thought I would suggest it over using something that is more complicated.
Otherwise you could look into using something like [man]str_replace[/man] or [man]preg_replace[/man]. You may also want to look into regular expressions in php.
Also a good search criteria may also be to look up BBcode as what you are trying to do is similar as far as finding certain tags and changing the content.