title: php - intersect multidemsional arrays with one same value
body: <p>I have array1 like this:</p>
  
  <pre><code>Array
  (
  [0] =&gt; Array
      (
          [0] =&gt; test
          [1] =&gt; 123
      )
  
  [1] =&gt; Array
      (
          [0] =&gt; testx
          [1] =&gt; 456
      )
  
  )
  </code></pre>
  
  <p>and array2 like this:</p>
  
  <pre><code>Array
  (
  [0] =&gt; Array
      (
          [0] =&gt; test
          [1] =&gt; somenumber
      )
  
  [1] =&gt; Array
      (
          [0] =&gt; title
          [1] =&gt; sometitle
      )
  [2] =&gt; Array
      (
          [0] =&gt; testx
          [1] =&gt; othernumber
      )
  
   )
  </code></pre>
  
  <p>I need output like this:</p>
  
  <pre><code>Array
  (
  [0] =&gt; Array
      (
          [0] =&gt; test
          [1] =&gt; 123
          [2] =&gt; somenumber
      )
  
  [1] =&gt; Array
      (
          [0] =&gt; testx
          [1] =&gt; 456
          [1] =&gt; othernumber
      )
  
  )
  </code></pre>
  
  <p>So I need to compare only value with [0]key of each array. I have tried combinations with array_intersect and array_diff but I just can't get it to work. Can anybody please point me in some direction, what is proper function/way to do this?</p>