I got arrays like this build upon data from a database representing single pages of a cms:
$page =
Array
(
[title] => mein produkt
[NavID] => 200
[parents] => Array
(
[0] => 0
[1] => 3
[2] => 200
)
)
And I need to put that into an other multidimensional array like this representing the sitemap:
$map =
Array
(
[NavID] => 0
[0] => Array
(
[childs] => Array
(
[1] => Array
(
[title] => home
[NavID] => 1
)
[2] => Array
(
[title] => impressum
[NavID] => 2
[childs] => Array
(
[100] => Array
(
[title] => startseite
[NavID] => 100
[parents] => Array
(
[0] => 0
[1] => 2
[2] => 100
)
)
)
)
[3] => Array
(
[title] => produkte
[NavID] => 3
)
)
)
)
As you see, I got the structure of the array as the array value on parents
.
So what I would do by hand is putting this like:
$map[0]['childs'][3]['childs'][200] = $page;
Put how can I select the multidimensional array with my array value $page['parents']
?
Thanks for helping me out.