To compare two arrays while considering duplicate value
<p>i have two arrays </p>

<pre><code>$array1 = array(1, 2,  2, 3);
$array2 = array( 1, 2,  3,4);
</code></pre>

<p>and when did : </p>

<pre><code>var_dump(array_diff($array1, $array2));
</code></pre>

<p>getting :</p>

<pre><code>array(0){}
</code></pre>

<p>as  output , but i am looking for :</p>

<pre><code>array(1){[2]=&gt;2}
</code></pre>

<p>can someone please let me know how to do it</p>

<p>Thanks in Advance</p>
