+}
+
+/** This function takes a string, tokenizes
+ * it by a space (chr 32), removes the first
+ * word/token, and returns the result.
+ * Mostly used for string manipulation around
+ * the source.
+ *
+ * Syntax:
+ * rparv(String $sentence)
+ *
+ * Returns:
+ * string|false
+ */
+function rparv($string)
+{
+ $parv = split($string);
+ $first = strlen($parv[0]) + 1;
+ $string = substr($string, $first);
+ if ($string)
+ return $string;
+ return false;
+}
+
+/* Taken from https://www.aviran.org/stripremove-irc-client-control-characters/
+ * We may want to re-base it off our UnrealIRCd's one though.
+ */
+function StripControlCharacters($text)
+{
+ $controlCodes = array(
+ '/(\x03(?:\d{1,2}(?:,\d{1,2})?)?)/', // Color code
+ '/\x02/', // Bold
+ '/\x0F/', // Escaped
+ '/\x16/', // Italic
+ '/\x1F/' // Underline
+ );
+ return preg_replace($controlCodes,'',$text);
+}