i feel stupid right now i cant get my head around it
i got a array with stdClass Objects and i whant sort them new or build a other array with it
Array
(
[0] => stdClass Object
(
[id] => 15
[top_id] => 13
[title] => Menu 6
[online] => 1
[displayOrder] => 15
)
[1] => stdClass Object
(
[id] => 14
[top_id] => 13
[title] => Menu 5
[online] => 0
[displayOrder] => 14
)
[2] => stdClass Object
(
[id] => 13
[top_id] => 0
[title] => Menu 4
[online] => 0
[displayOrder] => 13
)
[3] => stdClass Object
(
[id] => 12
[top_id] => 11
[title] => Menu 3
[online] => 1
[displayOrder] => 12
)
)
The Array i whant is like
(
[2] => stdClass Object
(
[id] => 13
[top_id] => 0
[title] => Menu 4
[online] => 0
[displayOrder] => 13
[children] =>
(
[id] => 11
[top_id] => 13
[title] => Menu 2
[online] => 0
[displayOrder] => 11
[children] =>
(
[id] => 12
[top_id] => 11
[title] => Menu 3
[online] => 1
[displayOrder] => 12
)
)
I tryed today multiple thing i found online but i cant get my head around the right answer/ or get it to work
pls could show me someone in the right direction with a small explaination why thats the way ?
thank you and best regards