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

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

WBOY
Release: 2016-06-01 12:09:23
Original
775 people have browsed it

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));
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template