/**
* gbk编码转utf-8
* @param unknown $data
* @return multitype:
*/
function gbk2utf8($data){
if(is_array($data)){
return array_map('gbk2utf8', $data);
}
return iconv('gbk', 'utf-8', $data);
}
$arr=array('id'=>1,'name'=>'小王');
echo json_encode(gbk2utf8($arr));