Order multidimensional array according to a second array : <p>I would like to order <code>$ArrayToOrder</code> according to column <code>SecondArrayField2</code> in <code>$SecondArray</code>, where the link between the two arrays are <code>Field_3</code> (in $ArrayToOrder) and <code>SecondArrayField1</code> in $SecondArray.</p>

<pre><code>$ArrayToOrder=Array
(
    [0] =&gt; Array
        (
            [Field_1] =&gt; 13
            [Field_2] =&gt; 15
            [Field_3] =&gt; 3
        )

    [1] =&gt; Array
        (
            [Field_1] =&gt; 25
            [Field_2] =&gt; 17
            [Field_3] =&gt; 2
        )

    [2] =&gt; Array
        (
            [Field_1] =&gt; 121
            [Field_2] =&gt; 20
            [Field_3] =&gt; 11
        )
)

$SecondArray=Array
(
    [0] =&gt; Array
        (
            [SecondArrayField1] =&gt; 11
            [SecondArrayField2] =&gt; Bruce                
        )

    [1] =&gt; Array
        (
            [SecondArrayField1] =&gt; 3
            [SecondArrayField2] =&gt; Arthur
        )

    [2] =&gt; Array
        (
            [SecondArrayField1] =&gt; 2
            [SecondArrayField2] =&gt; Mary
        )
)
</code></pre>

<p>Desired result as follows:</p>

<pre><code>$ArrayToOrder=Array
(
    [0] =&gt; Array
        (
            [Field_1] =&gt; 13
            [Field_2] =&gt; 15
            [Field_3] =&gt; 3 //(Arthur)
        )

    [1] =&gt; Array
        (
            [Field_1] =&gt; 121
            [Field_2] =&gt; 20
            [Field_3] =&gt; 11 //(Bruce)                  
        )

    [2] =&gt; Array
        (
            [Field_1] =&gt; 25
            [Field_2] =&gt; 17
            [Field_3] =&gt; 2 //(Mary)
        )
)   
</code></pre>
