title: Get the difference between arrays
body: <p>my mind is going to explode. need to get the array element which has an id of 4 and 6 in array 1. basically its the difference of these two arrays. i tried using for each loop but i cant get the output that i want</p>
  
  <pre><code>Array 1(
   0 =&gt; array(
          id: 1
            )
   1 =&gt; array(
          id: 4
            )
   2 =&gt; array(
          id: 5
            )
   3 =&gt; array(
          id: 6
            )
   )
  
  Array 2(
  
   0 =&gt; array(
          id: 1
            )
   1 =&gt; array(
          id: 5
            )
        )
  </code></pre>
  
  <p>the output i want:</p>
  
  <pre><code>new Array (
   0 =&gt; array (
        id: 4
              )
   1 =&gt; array (
        id: 6)
          )
  </code></pre>
  
  <p>what i've tried:</p>
  
  <pre><code>foreach ($array1 as $key =&gt; $value) {
      foreach ($array2 as $key2 =&gt; $value2) {
        if($value2['id']  !== $value['id']){
          $result['id'] = $value2['id'];
        }
      }
    }
  </code></pre>