function format_text($text, $html = 0, $word_wrap = 0, $bbcode = 0, $bbcode_img = 0) { if ($word_wrap && $text != "") { $text = preg_replace("/([^\n\r ?&\.\/<>\"\\-]{".$word_wrap."})/i", " \\1\n", $text); } if ($html == 0 || $html == 2) { $text = safe_htmlspecialchars($text); }