title: Sort and merge in a array
body: <p>I have trouble in handle array PHP, I have an array:</p>
  
  <pre><code>[0] {
  'email' =&gt; 'test@gmail.com',
  'meta' =&gt; {
            'product' =&gt; {
                          'id' =&gt; '1',
                          'content' =&gt; 'This is content'
                         }
            }
  }
  [1] {
  'email' =&gt; 'test2@gmail.com',
  'meta' =&gt; {
            'product' =&gt; {
                          'id' =&gt; '2',
                          'content' =&gt; 'This is content'
                         }
            }
  }
  [2] {
  'email' =&gt; 'test2@gmail.com',
  'meta' =&gt; {
            'product' =&gt; {
                          'id' =&gt; '3',
                          'content' =&gt; 'This is content'
                         }
            }
  }
  </code></pre>
  
  <p>I need to merge this array by value <code>'email'</code>, like this:</p>
  
  <pre><code>[0] {
      'email' =&gt; 'test@gmail.com',
      'meta' =&gt; {
                'product' =&gt; {
                              'id' =&gt; '1',
                              'content' =&gt; 'This is content'
                             }
                }
      }
  [1] {
      'email' =&gt; 'test2@gmail.com',
      'meta' =&gt; {
                'product' =&gt; [0] {
                                   'id' =&gt; '2',
                                   'content' =&gt; 'This is content'
                             }
                             [1] {
                                   'id' =&gt; '3',
                                   'content' =&gt; 'This is content'
                                 }
                }
      }
  </code></pre>
  
  <p>Could somebody help me?</p>