function object_to_array($variable){
if (is_object($variable)){
$array = array();
foreach ($variable as $key=>$value){
$array[$key] = object_to_array($value);
}
return $array;
} else{
return $variable;
}
}
No comments:
Post a Comment