标签:alt class code div ber php ret return space
function
arrayToObject(
$e
){
if
(
gettype
(
$e
)!=
‘array‘
)
return
;
foreach
(
$e
as
$k
=>
$v
){
if
(
gettype
(
$v
)==
‘array‘
||
getType
(
$v
)==
‘object‘
)
$e
[
$k
]=(object)arrayToObject(
$v
);
}
return
(object)
$e
;
}
function
objectToArray(
$e
){
$e
=(
array
)
$e
;
foreach
(
$e
as
$k
=>
$v
){
if
(
gettype
(
$v
)==
‘resource‘
)
return
;
if
(
gettype
(
$v
)==
‘object‘
||
gettype
(
$v
)==
‘array‘
)
$e
[
$k
]=(
array
)objectToArray(
$v
);
}
return
$e
;
}
标签:alt class code div ber php ret return space
原文地址:http://www.cnblogs.com/wenxinphp/p/6001365.html