title: PHP array_diff for multidimensional array by multiple columns
body: <p>I have two multidimensional arrays:</p>
  
  <pre><code>$arr_one = [
      [
          'param_one' =&gt; 'qwe',
          'param_two' =&gt; 'yellow'
      ],[
          'param_one' =&gt; 'xyz',
          'param_two' =&gt; 'blue'
      ],[
          'param_one' =&gt; 'abc',
          'param_two' =&gt; 'pink'
      ]
      ...
  ];
  
  $array_two = [
      [
          'param_one' =&gt; 'xyz',
          'param_two' =&gt; 'blue'
      ],[
          'param_one' =&gt; 'abc',
          'param_two' =&gt; 'pink'
      ]
      ...
  ];
  </code></pre>
  
  <p>Each one of this arrays has around <code>20.000</code> elements in it. I want to see which elements (sub-array) -including all its elements - is in the first array (<code>array_one</code>) but is not present in the second array (<code>array_two</code>).</p>
  
  <p>For this i've made this function: </p>
  
  <pre><code>function search_arr($needle, $haystack){
      $needle = array_values($needle);
  
      foreach ($haystack as $k =&gt; $v){
  
          if ( array_search($needle[0], $v) ){
  
              if ( array_search($needle[1], $v) ){
                  return true;
              }
          }
      }
      return false;
  }
  </code></pre>
  
  <p>And i am using it this way:</p>
  
  <pre><code>foreach($array_one as $arr){
      if(!search_arr($arr, $array_two)){
          $unique[] = $arr;
      }
  }
  </code></pre>
  
  <p>It works well for small arrays but in my case because each array has around <code>20.000</code> sub-arrays it takes forever to go trough all of them :(</p>
  
  <p>Is there a solution that will allow me to check which sub-array (with all its elements) exists in <code>array_one</code> but doesn't exist in <code>array_two</code>?</p>