数据统一格式化

function toObject($object){
    $newData = [];
    $data=json_decode($object,true);
    foreach ($data as $key => $val){
        if(is_array($data[$key]) && count(array_filter(array_keys($data[$key]),'is_string')) && isset($val['err'])){
            $newOne[$key.'.'.'err'] = $val['err'];
            $newData = array_merge($newData,$newOne);
        }elseif (is_array($data[$key]) && count(array_filter(array_keys($data[$key]),'is_string'))==0 && count($val) == count($val, 1)){
            $newList = [];
            for($i=0;$i 
 

你可能感兴趣的:(开发语言,php)