';
$text = ' test [i]test[/i] test [b]test[/b] test [u]test[/u] test [i]test test';
echo $text . '
';
echo htmlentities($text) . '
';
$text = preg_replace('!\[(i|b|u)\](.*?)\[/\\1\]!is', '<\\1>\\2\\1>', $text);
echo $text . '
';
echo htmlentities($text) . '
';
echo '';
?>