数组数据编码格式转换
来源:互联网 发布:hashmap的hash算法 编辑:程序博客网 时间:2024/05/20 01:11
//编码格式转换
function format_C($gg,$uu,$arr){
format_change($gg, $uu,$arr,true);
return $arr;
}
function format_change($gg,$uu,&$arr,$apply_to_keys = false){
static $aa_counter=0;
if(++$aa_counter>6){
die('possible deep attack');
}
foreach($arr as $key=>$value){
if(is_array($value)){
format_change($gg,$uu,$arr[$key],true);
}else{
$arr[$key] = iconv($gg,$uu,$value);
}
if($apply_to_keys && is_string($key)){
$new_key = iconv($gg,$uu,$key);
if($new_key!=$key){
$arr[$new_key] = $arr[$key];
unset($arr[$key]);
}
}
}
$aa_counter--;
}
function format_C($gg,$uu,$arr){
format_change($gg, $uu,$arr,true);
return $arr;
}
function format_change($gg,$uu,&$arr,$apply_to_keys = false){
static $aa_counter=0;
if(++$aa_counter>6){
die('possible deep attack');
}
foreach($arr as $key=>$value){
if(is_array($value)){
format_change($gg,$uu,$arr[$key],true);
}else{
$arr[$key] = iconv($gg,$uu,$value);
}
if($apply_to_keys && is_string($key)){
$new_key = iconv($gg,$uu,$key);
if($new_key!=$key){
$arr[$new_key] = $arr[$key];
unset($arr[$key]);
}
}
}
$aa_counter--;
}
0 0
- 数组数据编码格式转换
- json格式数据转换为java数组
- java 数组转换为json格式数据
- 数组转换成json格式的数据
- android json数据传递时编码格式的转换
- android json数据传递时编码格式的转换
- python: json.dumps()中的参数,数据编码格式转换
- mysql编码格式转换
- 编码格式转换
- 编码格式的转换
- 字符编码格式转换
- 编码格式转换
- 文件编码格式转换
- JAVA编码格式转换
- Unicode编码格式转换
- 编码格式转换
- 编码格式转换
- 编码格式转换
- linux-搭建web服务器系列--搭建mysql数据库(二)
- 滤波器的阶数
- Lua——分类目录
- JavaScript的构造函数原理
- 渣渣的第一天
- 数组数据编码格式转换
- IOS 移动端视频播放不全屏
- java单元测试Junit实践(一) Junit基础
- 我读《基于OpenFlow的视频用户QoE优化研究》
- 对六种平衡树的研究与探索【全面】【更新中】
- codeforces 757 B. Bash's Big Day
- 申请免费的https证书-Let's Encrypt
- win32 python3.5 下安装sklearn
- 为hadoop集群设置静态IP