title: PHP Merge array with same keys and one same value
body: <p>I need to merge a PHP array, this array has 2 arrays into it named "targetXX", I can have 2 or more. Each target have the same keys, for each key I have an array with 2 values a and b, a is always the same in both targets, but I need to merge both B values like this:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [target] =&gt; hitcount(stats.asdf1.requests, "1min")
              [datapoints] =&gt; Array
                  (
                      [0] =&gt; Array
                          (
                              [0] =&gt; 1200
                              [1] =&gt; 1392282200
                          )
  
                      [1] =&gt; Array
                          (
                              [0] =&gt; 1400
                              [1] =&gt; 1392282260
                          )
  
                      [2] =&gt; Array
                          (
                              [0] =&gt; 600
                              [1] =&gt; 1392282320
                          )
  
                      [3] =&gt; Array
                          (
                              [0] =&gt; 200
                              [1] =&gt; 1392282380
                          )
  
                      [4] =&gt; Array
                          (
                              [0] =&gt; 400
                              [1] =&gt; 1392282440
                          )
  
                      [5] =&gt; Array
                          (
                              [0] =&gt; 600
                              [1] =&gt; 1392282500
                          )
                  )
          )
      [1] =&gt; Array
          (
              [target] =&gt; hitcount(stats.asdf.requests, "1min")
              [datapoints] =&gt; Array
                  (
                      [0] =&gt; Array
                          (
                              [0] =&gt; 4321
                              [1] =&gt; 1392282200
                          )
  
                      [1] =&gt; Array
                          (
                              [0] =&gt; 76567
                              [1] =&gt; 1392282260
                          )
  
                      [2] =&gt; Array
                          (
                              [0] =&gt; 5556
                              [1] =&gt; 1392282320
                          )
  
                      [3] =&gt; Array
                          (
                              [0] =&gt; 7675
                              [1] =&gt; 1392282380
                          )
  
                      [4] =&gt; Array
                          (
                              [0] =&gt; 2344
                              [1] =&gt; 1392282440
                          )
  
                      [5] =&gt; Array
                          (
                              [0] =&gt; 0999
                              [1] =&gt; 1392282500
                          )
                  )
          )
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>    Array
  (
      [0] =&gt; Array
          (
              [target] =&gt; hitcount(stats.asdf1.requests, "1min")
              [datapoints] =&gt; Array
                  (
                      [0] =&gt; Array
                          (
                              [0] =&gt; 1200
                              [1] =&gt; 1392282200
                              [2] =&gt; 4321
                          )
  
                      [1] =&gt; Array
                          (
                              [0] =&gt; 1400
                              [1] =&gt; 1392282260
                              [2] =&gt; 76567
                          )
  
                      [2] =&gt; Array
                          (
                              [0] =&gt; 600
                              [1] =&gt; 1392282320
                              [2] =&gt; 5556
                          )
  
                      [3] =&gt; Array
                          (
                              [0] =&gt; 200
                              [1] =&gt; 1392282380
                              [2] =&gt; 7675
                          )
  
                      [4] =&gt; Array
                          (
                              [0] =&gt; 400
                              [1] =&gt; 1392282440
                              [2] =&gt; 2344
                          )
  
                      [5] =&gt; Array
                          (
                              [0] =&gt; 600
                              [1] =&gt; 1392282500
                              [2] =&gt; 0999
                          )
                  )
          )
  </code></pre>