I have this array:
`$arr = array(
'foo' => 'foo',
'bar' => array(
'baz' => 'baz',
'candy' => 'candy',
'vegetable' => array(
'carrot' => 'carrot',
),
),
);
and I want to change it to this:
$arr = array(
'0' => 'foo',
'1' => array(
'0' => 'baz',
'1' => 'candy',
'2' => array(
'0' => 'carrot',
)
),
);
I have tried array_values function but it changes only the first level, like this:
$arr = array(
'0' => 'foo',
'1' => array(
'baz' => 'baz',
'candy' => 'candy',
'vegetable' => array(
'carrot' => 'carrot',
)
),
);