function array_to_object($variable){
if (is_array($variable)){
$object = new StdClass();
foreach ($variable as $key=>$value){
$object->$key = array_to_object($value);
}
return $object;
} else{
return $variable;
}
}
No comments:
Post a Comment