How to get the difference of two multidimensional arrays in php?
<p>I want to get the difference of two multidimensional arrys, e.g.,</p>

<p>First Array:</p>

<pre><code>Array
(
    [qtr_selected] =&gt; Array
        (
            [partner_q_m_p__2031] =&gt; Array
                (
                    [0] =&gt; q1
                    [1] =&gt; q2
                )

            [partner_q_m_p__2032] =&gt; Array
                (
                    [0] =&gt; q1
                )

        )

)
</code></pre>

<p>Second Array: </p>

<pre><code> Array
(
    [qtr_completed] =&gt; Array
        (
            [partner_q_m_p__2031] =&gt; Array
                (
                    [0] =&gt; q1
                )

        )

)
</code></pre>

<p>how do i get the difference of array1 &amp; array2 as given below:</p>

<pre><code>   Array
(
    [qtr_final] =&gt; Array
        (
            [partner_q_m_p__2031] =&gt; Array
                (
                    [0] =&gt; q2
                )

            [partner_q_m_p__2032] =&gt; Array
                (
                    [0] =&gt; q1
                )

        )

)
</code></pre>

<p>Tried array_diff() function but not getting  array1 as difference except array2, i want array1 after subtracting array2 from it.</p>