将如下这段php代码用java怎么实现。function escapeForXML ($input) {
$patterns = array(
"/\s+/",
"/[\x-\x8\xb-\xc\xe-\x1f]/", //escape invalid Unicode in XML
"/<.*?>/" //remove html tag
);
$replace = array(
" ",
" ",
""
);
$output .= preg_replace($patterns, $replace, $input);
return trim(htmlspecialchars($output));
}
$patterns = array(
"/\s+/",
"/[\x-\x8\xb-\xc\xe-\x1f]/", //escape invalid Unicode in XML
"/<.*?>/" //remove html tag
);
$replace = array(
" ",
" ",
""
);
$output .= preg_replace($patterns, $replace, $input);
return trim(htmlspecialchars($output));
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货