// 格式化json中的汉字函数
protected function encode_json($str) {
$strs = urldecode(json_encode($this->url_encode($str)));
return $strs;
}
protected function url_encode($str) {
if(is_array($str)) {
foreach($str as $key=>$value) {
$str[urlencode($key)] = $this->url_encode($value);
}
} else {
$str = urlencode($str);
}
return $str;
}