// [B]old $text = preg_replace('/\[B](.+?)\[\/B]/i', '$1', $text); // [I]talic $text = preg_replace('/\[I](.+?)\[\/I]/i', '$1', $text);