如何在循环中的复杂数组的最低级别设置数组条目?

Ok, I admit the question is confusing but I don't know how to say it in another way. I have an array that looks like this:

array(3) {
  [0]=>
  array(1) {
    [some_middle-level_id]=>
    array(1) {
      [some_low-level_id]=>
      array(5) {
        ["entry1"]=>
        string(...) "..."
        ["entry2"]=>
        string(...) ""
        ...
      }
    }
  }  
  [1]=>
  array(1) {
    [another_middle-level_id]=>
    array(5) {
      [another_low_level_id]=>
      array(5) {
        ["entry1"]=>
        string(...) "..."
        ["entry2"]=>
        string(...) ""
        ...
      }
    }
  }
  [2]=>
  array(1) {
    [another_middle-level_id]=>
    array(5) {
      [another_low_level_id]=>
      array(5) {
        ["entry1"]=>
        string(...) "..."
        ["entry2"]=>
        string(...) ""
        ...
      }
      [another_low_level_id]=>
      array(5) {
        ["entry1"]=>
        string(...) "..."
        ["entry2"]=>
        string(...) ""
        ...
      }
    }
  }

EDIT: The other array would look like this. Let's say there are 3 [low_level_id] in the first array then the other array would simply look like this:

array(3) { [0]=> string(3) "bla" [1]=> string(4) "blub" [2]=> string(6) "lalala"}

and another array that have as many entries as "low level id"-entries exist. In every "low level id"-entry which contains 5 entries at the moment I want to add a sixth entry - a string from the other array. But I don't know how to access it. Is there away to access it without using hundreds of loops?

Another EDIT: I could access the first entry with:

foreach($my_array as $key => $subkey){
    foreach($subkey as $val){
         $my_array[$key][key($subkey)][key($val)]['6th_entry']="a new string";
    }
}

But that works only for the first new entry. I don't know how to access the others and how to add a loop for adding entries from the other array.

You can use nested calls of array_map. Assuming $array is 1st array and $another_array is 2nd array, the code should look like this:

$result = array_map(
    function ($elem1) use(&$another_array) {
        return array_map(
            function ($elem2) use(&$another_array) {
                return array_map(
                    function ($elem3) use(&$another_array) {
                        list(, $val) = each($another_array);
                        $elem3['entry6'] = $val;
                        return $elem3;
                    },
                    $elem2
                );
            },
            $elem1
        );
    },
    $array
);

Demo