Sort array according to value of key
<p>I have one array which have the right order of the keys, 
For example,</p>

<pre><code>$array_keysorder=([0]=&gt;"Fire",[1]=&gt;"Sky",[2]=&gt;"Third")

//Array i want to sort,after appending the order is messed up
$tosortarray=(['Sky']=&gt;array(array()...),['Third']=&gt;array(),['Fire']=&gt;array())

//This is how i want the final array to look like 
$Final=(['Fire']=&gt;array(), ['Sky']=&gt;array(array()...),['Third']=&gt;array())
</code></pre>
