Swap two key/value pairs in an array
<p>I have an array:</p>

<pre><code>$array = array('a' =&gt; 'val1', 'b' =&gt; 'val2', 'c' =&gt; 'val3', 'd' =&gt; 'val4');
</code></pre>

<p>How do I swap any two keys round so the array is in a different order?  E.g. to produce this array:</p>

<pre><code>$array = array('d' =&gt; 'val4', 'b' =&gt; 'val2', 'c' =&gt; 'val3', 'a' =&gt; 'val1');
</code></pre>

<p>Thanks :).</p>
