title: Move child array to parent array php
body: <p>I have an php array like:-</p>
  
  <pre><code>Array
  (
     [colors] =&gt; Array
        (
          [0] =&gt; white
          [1] =&gt; Yellow
          [2] =&gt; Black
          [3] =&gt; white
          [4] =&gt; Array
              (
                  [0] =&gt; white
                  [1] =&gt; Black
              )
  
          [5] =&gt; Array
              (
                  [0] =&gt; white
                  [1] =&gt; Black
              )
          [6] =&gt; white
          [7] =&gt; red
      )
  
  )
  </code></pre>
  
  <p>Now I want Output like:</p>
  
  <pre><code>Array
  (
     [colors] =&gt; Array
      (
        [0] =&gt; white
        [1] =&gt; Yellow
        [2] =&gt; Black
        [3] =&gt; white
        [4] =&gt; white
        [5] =&gt; Black
        [6] =&gt; white
        [7] =&gt; Black
        [8] =&gt; white
        [9] =&gt; red
     )
  )
  </code></pre>
  
  <p>Means if array element has array value then it will be moved to parent. I don't want child layer. Please suggest how can I achieve</p>