title: LEFT JOIN but in PHP Array
body: <p>I have two arrays.</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [id] =&gt; 12
              [user_id] =&gt; 1
              [date] =&gt; 2013-10-21 23:01:52
              [type] =&gt; 1
              [name] =&gt; Wypłata UNDICOM
              [quantity] =&gt; 0
              [value] =&gt; 1700
          )
  
      [1] =&gt; Array
          (
              [id] =&gt; 13
              [user_id] =&gt; 1
              [date] =&gt; 2013-10-21 23:01:52
              [type] =&gt; 0
              [name] =&gt; Rata (gwarancja MacBook Air)
              [quantity] =&gt; 0
              [value] =&gt; 90
          )
  
      [2] =&gt; Array
          (
              [id] =&gt; 16
              [user_id] =&gt; 1
              [date] =&gt; 2013-10-21 23:01:52
              [type] =&gt; 0
              [name] =&gt; TESCO (zakupy)
              [quantity] =&gt; 0
              [value] =&gt; 0
          )
  
  )
  Array
  (
      [0] =&gt; Array
          (
              [id] =&gt; 3
              [data_id] =&gt; 16
              [name] =&gt; Coca-Cola
              [quantity] =&gt; 2
              [value] =&gt; 5
          )
  
      [1] =&gt; Array
          (
              [id] =&gt; 4
              [data_id] =&gt; 16
              [name] =&gt; Pizza
              [quantity] =&gt; 1
              [value] =&gt; 10
          )
  
  )
  </code></pre>
  
  <p>I want to display this two arrays, but first array is a category and second have elements.
  The relations are between id (first array) and data_id (second array).
  In MySQL is simple LEFT JOIN, but i have no idea if is function like that in PHP.
  I just tried code some if's etc. but without success.
  I want a simple solution, so if it's impossibile then tell me that.</p>
  
  <p>Cheers!</p>