应用范围:淘宝api中用的
function objToArr($obj){ $ret = array(); foreach($obj as $key =>$value){ if(gettype($value) == 'array' || gettype($value) == 'object'){ $ret[$key] = objtoarr($value); } else{ $ret[$key] = $value; } } return $ret; }