title: php array_intersect is showing no intersection
body: <p>I have two arrays $t1 and $t2.  When I print them out I get the following:</p>
  
  <p>t1:</p>
  
  <pre><code>Array ( [0] =&gt; Christina Aguilera [1] =&gt; Iron Maiden [2] =&gt; Bob Marley ) 
  </code></pre>
  
  <p>t2:</p>
  
  <pre><code>Array ( [0] =&gt; Bob Marley )
  </code></pre>
  
  <p>I'm trying to get the common elements of the array though the array_intersect function, and I'm using the below line:</p>
  
  <pre><code>$intersection = array_intersect($t1,$t2);
  </code></pre>
  
  <p>However, for some reason when I print the result $intersection I get get:</p>
  
  <pre><code>Array ( )
  </code></pre>
  
  <p>Can anybody see what it is going wrong?  The code for my function is below but I think the above should be sufficient to work it out.</p>
  
  <pre><code>// For extra information
  function findMutualInterests($_uProArray, $_tProArray)
  {
      $_commonDetails = null;
  
      $_fieldNames = array_keys($_uProArray[0]);
      $_uProValues = array_values($_uProArray[0]);
      $_tProValues = array_values($_tProArray[0]);
      //print_r($_uProValues);
  
      // Iterate over the arrays and find ones in common
      for ($i = 0; $i &lt; count($_uProValues); $i++) {
          $t1 = explode(',',$_uProValues[$i]);
          print_r($t1);
          $t2 = explode(',',$_tProValues[$i]);
          print_r($t2);
          $intersection = array_intersect($t1,$t2);
          print_r($intersection);
          $_commonDetails[$_fieldNames[$i]] = implode($intersection);
      }
      return $_commonDetails;
  }
  </code></pre>
  
  <p>EDIT:  Just thought I would point out that the output of $t1 and $t2 shown above are the output of a single iteration of the below function.  I just chose that one as an example.</p>