php json转数组

function objtoarr($curl){
  $ret = array();
  foreach($curl as $key =>$value){
    if(gettype($value) == 'array' || gettype($value) == 'object'){
      $ret[$key] = objtoarr($value);
    }else{
      $ret[$key] = $value;
    }
  }
  return $ret;
}

你可能感兴趣的:(php json转数组)