I Have the next array: Array ( [1000] => Array ( [pv] => 81 )
[1101] => Array
(
[1102] => Array
(
[pv] => 33
)
[1103] => Array
(
[pv] => 15
)
[pv] => 72
)
) I want to make new array from this like this:
Array(
[1000] => Array([ generation ] => 1, [ pv ] => 81)
[1101] => Array([ generation ] => 1, [ pv ] => 72)
[1102] => Array([ generation ] => 2, [ pv ] => 33)
[1103] => Array([ generation ] => 2, [ pv ] => 15)
)
Generation is a level of array s deep. There are a lot of levels. Thanks.