Compare the lengths arrays that have duplicates
<p>I wish to determine whether there are any duplicates in two arrays, i.e. duplicates in array1 or duplicates in array2.  If there are, then set a variable to equal 1, otherwise 0. I have the following code but it does not seem to work and I cannot understand why:</p>

<pre><code>$a = count(array_unique($myarraydf));
$b = count($myarraydf);
$c = count(array_unique($myarrayds));
$d = count($myarrayds);

if (($a == $b) || ($c == $d)) {
$ties = 0;
   }
else {
    $ties = 1;
}
</code></pre>

<p>where $myarraydf and $myarrayds are arrays of numeric values.</p>
