function bbcode2html($text) { global $bbcode; if (!isset($bbcode)) { $bbcode = new bbcode(); } $orig_word = array(); $replacement_word = array(); obtain_word_list($orig_word, $replacement_word); if (count($orig_word)) { $text = preg_replace($orig_word, $replacement_word, $text); } return $bbcode->bbcode2html($text); }