PHP manage array
<p>I have below array which I want to transform to another form. Can you please help.</p>

<p>I want comman values to be in one array say in above example 3 is common values in first two array so, It'll come under 3 and rest will transform 0th element as key and 1st element as value. </p>

<p>Input: </p>

<pre><code>Array (  
    [0] =&gt; Array
        (
            [0] =&gt; 1
            [1] =&gt; 3
        )  
    [1] =&gt; Array
        (
            [0] =&gt; 2
            [1] =&gt; 3
        )  
    [2] =&gt; Array
        (
            [0] =&gt; 5
            [1] =&gt; 4
        )
)  
</code></pre>

<p>Output:</p>

<pre><code>Array
(
    [3] =&gt; Array  
        (
            [0] =&gt; 1
            [1] =&gt; 2
        )
    [5] =&gt; Array  
        (
            [0] =&gt; 4
        )
)
</code></pre>
