PHP - sort associative array by another indexed array
<p>I have the following arrays:</p>

<pre><code>$arr = array(
 'keyA' =&gt; 'valueA',
 'keyB' =&gt; 'valueB',
 'keyC' =&gt; 'valueC',
 'keyD' =&gt; 'valueD'
);

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

<p>I need to sort $arr based on $order so the output be </p>

<pre><code>array(
   'keyC' =&gt; 'valueC',
   'keyD' =&gt; 'valueD', 
   'keyA' =&gt; 'valueA',
   'keyB' =&gt; 'valueB'   
</code></pre>

<p>);</p>

<p>Can someone help me?</p>

<p>Thanks.</p>
