function rewritesafe_removeothers($str){ $str = Web::rewritesafe($str); preg_match_all("/[\/A-z_-\d]+/", $str, $matches); $newstr = implode("_", $matches[0]); return $newstr; }