Sort Result array by an Array with keys
<p>I have 2 Arrays:</p>

<p>(1) Array with Key => Value, and Array (2) with no relevant Keys and as Values the keys from array 1 in different order. Is there an elegant solution to put array 1 in the same order like the values in array two?</p>

<pre><code>$data = array(
'NAME' =&gt; 'XYZ',
'NUMB' =&gt; 1234,
'CITY' =&gt; 'TEST'
);

$sort = array(
'A1' =&gt; 'CITY',
'XY' =&gt;  'NUMB',
'XX' =&gt; 'NAME',
);

$result = array(
'CITY' =&gt; 'TEST,
'NUMB' =&gt; 1234,
'NAME' =&gt; 'XYZ',
);
</code></pre>
