How to ‘flatten’ a multi dimensional array of unknown depth and length AND record it’s parent-child relations? [closed] arrays flatten multidimensional-array php I have a PHP array that looks like this: Array ( [0] => Array ( [id] => 2 [name] => Item2 [children] => Array ( …