Home >Backend Development >PHP Tutorial >PHP gbk环境下json_dencode传送来的汉字_PHP

PHP gbk环境下json_dencode传送来的汉字_PHP

WBOY
WBOYOriginal
2016-06-01 12:09:23769browse

JSON

复制代码 代码如下:
function ArrEncode($arr){
foreach($arr as $k=>$v){
if(is_array($v)){
$arr[$k] =ArrEncode($v);
}else{
$arr[$k] = urlencode($v);
}
}
return $arr;
}
在控制器方法里面可以。
$arr = ArrEncode($uns);
echo urldecode(json_encode($arr));
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn