I’m trying to add elements to a sub array of the sub array where they were added in the previous iteration, i.e. transforming this:
$a = array('a', 'b', 'c');
Into this:
$new_array = array(
'a' => array(
'b' => array(
'c' => array()
)
)
);
1 Answer