You are here

function node_export_json_decode_objects in Node export 7.3

Recursively convert arrays back to objects.

1 call to node_export_json_decode_objects()
node_export_json_import in formats/json.inc
Import callback.

File

formats/json.inc, line 43
The Node export JSON format handler.

Code

function node_export_json_decode_objects($array) {
  if (is_array($array)) {
    foreach ($array as $k => $v) {
      if (is_array($v)) {
        $array[$k] = node_export_json_decode_objects($v);
      }
    }
    if (isset($array['#node_export_object'])) {
      unset($array['#node_export_object']);
      $array = (object) $array;
    }
    return $array;
  }
}