$1",
"$1",
"$1",
"$1",
"$1",
"$2",
"",
"$1",
"$2",
"$2",
"",
);
// Do simple BBCode's
$str = preg_replace ($simple_search, $simple_replace, $str);
// Do
BBCode $str = bbcode_quote ($str); return $str; } function bbcode_quote ($str) { //added div and class for quotes $open = ''; } // Do replacement $str = str_replace ('[' . 'quote]', $open, $str); $str = str_replace ('[/' . 'quote]', $close, $str); return $str; } ?>'; $close = ''; // How often is the open tag? preg_match_all ('/\[quote\]/i', $str, $matches); $opentags = count($matches['0']); // How often is the close tag? preg_match_all ('/\[\/quote\]/i', $str, $matches); $closetags = count($matches['0']); // Check how many tags have been unclosed // And add the unclosing tag at the end of the message $unclosed = $opentags - $closetags; for ($i = 0; $i < $unclosed; $i++) { $str .= '