PHP- Combine child element of an array into an array : <p>i had an array of data like this<br>
    <pre>
    array(3) {
      [0]=>
      array(5) {
        ["cate_title"]=>
        string(30) "Printer Line - Round With Date"
        ["attr_id"]=>
        string(2) "15"
        ["attr"]=>
        string(6) "asdasd"
        ["option"]=>
        string(6) "asdasd"
        ["data_name"]=>
        array(0) {
        }
      }
      [1]=>
      array(5) {
        ["cate_title"]=>
        string(1) "w"
        ["attr_id"]=>
        string(2) "14"
        ["attr"]=>
        string(4) "asda"
        ["option"]=>
        string(5) "sdasd"
        ["data_name"]=>
        array(0) {
        }
      }
      [2]=>
      array(5) {
        ["cate_title"]=>
        string(1) "w"
        ["attr_id"]=>
        string(2) "13"
        ["attr"]=>
        string(3) "aaa"
        ["option"]=>
        string(8) "checkbox"
        ["data_name"]=>
        array(1) {
          [0]=>
          string(3) "bbb"
        }
      }
    }
    </pre></p>

<p>i want to combine 2 elenment that has the same <code>cate_title = w</code> into 1 array like this</p>

<pre class="lang-html prettyprint-override"><code>&lt;pre&gt;
array(3) {
  [0]=&gt;
  array(5) {
    ["cate_title"]=&gt;
    string(30) "Printer Line - Round With Date"
    ["attr_id"]=&gt;
    string(2) "15"
    ["attr"]=&gt;
    string(6) "asdasd"
    ["option"]=&gt;
    string(6) "asdasd"
    ["data_name"]=&gt;
    array(0) {
    }
  }
  [1]=&gt;  
  array(2) {
    ["cate_title"]=&gt;string(1) "w"  

      ["data-child"]=&gt;array(2){
        [0]=&gt;array {

        ["attr_id"]=&gt;string(2) "14"

        ["attr"]=&gt;string(4) "asda"

        ["option"]=&gt;string(5) "sdasd"

        ["data_name"]=&gt; array(0) {    }

        }
        [1]=&gt;array {

        ["attr_id"]=&gt;string(2) "13"

        ["attr"]=&gt;string(4) "aaa"

        ["option"]=&gt;string(5) "checkbox"

        ["data_name"]=&gt; array(1) {
            [0]=&gt;
            string(3) "bbb"

            }    
        }

    }

  }

&lt;/pre&gt;
</code></pre>

<p>please help me, i've searched everywhere but still no answers </p>
