title: Array merge on key of two associative arrays in php?
body: <p>How can I merge these two array together?</p>
  
  <pre><code>Array
  (
  [0] =&gt; Array
      (
          [id] =&gt; 5
          [cnt] =&gt; 14
      )
  
  [1] =&gt; Array
      (
          [id] =&gt; 8
          [cnt] =&gt; 2
      )
  
  )
  
  Array
  (
      [0] =&gt; Array
          (
              [id] =&gt; 8
              [binding] =&gt; hardcover
          )
  
      [1] =&gt; Array
          (
              [id] =&gt; 5
              [binding] =&gt; softcover
          )
  )
  </code></pre>
  
  <p>The expected result is:</p>
  
  <pre><code>Array
      (
          [0] =&gt; Array
              (
                  [id] =&gt; 5
                  [binding] =&gt; softcover
                  [cnt] =&gt; 14
              )
  
          [1] =&gt; Array
              (
                  [id] =&gt; 8
                  [binding] =&gt; hardcover
                  [cnt] =&gt; 2
              )
  
      )
  </code></pre>
  
  <p>The merge of these two array should happen on the [id] value and not on any sort of the array. How can I do this with php in a fast way?</p>