Hi guys,
How is is possible, using PHP to add a new index to each 'level' of an multidimensional array?
For instance, for the following array:
$array = array(
'a' => 'a val',
'b' => array(
'ba' => 'ba value',
'bb' => array(
'bba' => 'bba value'
),
'bc' => 'bc value'
),
'c' => 'c val',
'd' => 'd val'
);
... would turn into:
$array = array(
'a' => 'a val',
'b' => array(
'ba' => 'ba value',
'bb' => array(
'bba' => 'bba value',
'new index' => 'new index value'
),
'bc' => 'bc value',
'new index' => 'new index value'
),
'c' => 'c val',
'd' => 'd val',
'new index' => 'new index value'
);
Thanks in advance,
titel