Convert associative multidimensional array into single-dimensional array with treepath keys
<p>I have a multi-dimensional associative array like this one:</p>

<pre><code>array (size=2)
  'a' =&gt; 
    array (size=3)
      'b' =&gt; string 'this' (length=4)
      'c' =&gt; string 'is' (length=2)
      'd' =&gt; string 'a test' (length=6)
  'c' =&gt; 
    array (size=4)
      0 =&gt; int 1
      1 =&gt; int 2
      2 =&gt; int 3
      3 =&gt; 
        array (size=1)
          'd' =&gt; string '123' (length=3)
</code></pre>

<p>I try to flatten it to a single-dimensional associative array with the treepath as keys:</p>

<pre><code>array (size=7)
  'a&gt;b' =&gt; string 'this' (length=4)
  'a&gt;c' =&gt; string 'is' (length=2)
  'a&gt;d' =&gt; string 'a test' (length=6)
  'c&gt;0' =&gt; string '1' (length=1)
  'c&gt;1' =&gt; string '2' (length=1)
  'c&gt;2' =&gt; string '3' (length=1)
  'c&gt;3&gt;d' =&gt; string '123' (length=3)
</code></pre>

<p>See my attempt here: <a href="http://codepad.org/MGaBPpZP" rel="nofollow">http://codepad.org/MGaBPpZP</a></p>