Array in ein Objekt umwandeln
function array2Object($array){ $object = new stdClass(); foreach ($array as $key => $value) { if (is_array($value)) { $object->$key = array2Object($value); } else { $object->$key = $value; } } return $object; }
Objekt in ein Array umwandeln
function object2Array($object){ $array = array(); foreach ($object as $key => $value) { $array[$key] = object2Array($value); } return $array; }