Given the following array
$a = array(
'a' => '0',
'b' => '1',
'c' => '2',
'push' => array(
'd' => '0',
'e' => '1',
'here' => array()
)
);
And the following set of loops:
// First level
foreach($a as $key=>$value):
if($key=='push'):
//Second level
foreach($value as $key_=>$value_):
if($key_=='here'):
// If this key is found then do some stuff here and get another as a result array
$thirdArray = array(12, 13, 15);
// Then, I am looking to push this third array from within this loop
// Obviously, it should be placed inside this particular key of the array
// I am trying something like below which doesn't work
//array_push($value_, $thirdArray);
endif;
endforeach;
endif;
endforeach;
/* The output of printing my array should be
'a' => 'A',
'b' => 'B',
'c' => 'C',
'push' => array(
'd' => '0',
'e' => '1',
'here' => array(
array(12, 13, 15)
)
*/
This is giving me a big headache... and can't seem to find a solution.. Many thanks for your help in advance..