xxynew
新手上路

UID 111954
精华
0
积分 10
帖子 4
金钱 10 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2008-2-28
状态 离线
|
[广告]: 代充Paypal帐号美元
一段php代码要转为java,麻烦各位高手了!
function _encodeString(&$string)
{
// Escape these characters with a backslash:
// " \ / \n \r \t \b \f
$search = array('\\', "\n", "\t", "\r", "\b", "\f", '"');
$replace = array('\\\\', '\\n', '\\t', '\\r', '\\b', '\\f', '\"');
$string = str_replace($search, $replace, $string);
// Escape certain ASCII characters:
// 0x08 => \b
// 0x0c => \f
$string = str_replace(array(chr(0x08), chr(0x0C)), array('\b', '\f'), $string);
return '"' . $string . '"';
}
|
|