title: How to check if array has some elements same as another array and to pop those elements out of array
body: <p>I have an <code>array</code> like this: </p>
  
  <pre><code>array(1) {
    [0]=&gt;
    string(16) "1785328791698338"
  }
  </code></pre>
  
  <p>And other <code>array</code> like this:</p>
  
  <pre><code>array(7) {
    [0]=&gt;
    string(17) "10207252567926988"
    [1]=&gt;
    string(17) "10208823390691752"
    [2]=&gt;
    string(17) "10209064245580796"
    [3]=&gt;
    string(16) "1274474365912572"
    [4]=&gt;
    string(16) "1294280923934896"
    [5]=&gt;
    string(16) "1317727711586522"
    [6]=&gt;
    string(16) "1785328791698338"
  }
  </code></pre>
  
  <p>I should check if some of the elements(in this case only one, but it can vary) from first array are same as some elements in second array, and if they are, to remove them from first array. I tried doing it this way, but it does't work:</p>
  
  <pre><code>function findSameValuesOfArrays($arrayOne,$arrayTwo){
           $newArray=array();
           foreach($arrayOne as $a){
              $newArray[0]=$a;
           }
           foreach($arrayTwo as $b){
              $newArray[1]=$b;
           }
           if (strpos($newArray[1],$newArray[0])) {
              return true;
           }
  
      }
  </code></pre>
  
  <p>This is just to find if there are same elements, and then i would probably unset key where those values are. But function returns <code>NULL</code>.</p>