I have a messy tree multidimensional array that I want to do the following to:
Extract each array, no matter how far nested down to put it into a single "holder array", so this (just a basic example as it would be much more complex than this as far as the nesting)
$this = array[0]=> (array[1]=>('a','b'),
array[2]=>(array[3]=>('c','d')));
would become something like this, it doesn't matter if it changes the index for each array, just so that they are still in an array, but "flat" so the only nesting is within the one main holder array
$would_become = array[holder]=>(array[1]=>('a','b'),
array[2]=>(),
array[3]=>('c','d'));
The overall reasoning behind this is that I have a bunch of nested arrays that have a common key, such as ['filepath'] and I want to be able to do something like below (would need to make it go through each array in the holder array obviously, but this shows the basic idea behind why i need this.
foreach ($holder_array as $holder_array) {
// as an example:
echo $holder_array['Path']
}