PHP сгладить массив и добавить ключ глубины
У меня есть следующий массив: Array ( [0] => Array ( [id] => 2 [title] => Root 2 [description] => [site_id] => 1 [parent_id] => 0 [created_at] => [updated_at] => [children] => Array ( [0] => Array ( [id] => 4 [title] => Child 2 [description] => [site_id] => 1 [parent_id] => 2 [created_at] => […]