Switch multidimensional array key for value from within array
<p>I have the following multidimensional array, returned from a query:</p>

<pre><code>Array
(
    [0] =&gt; Array
        (
            [dimension] =&gt; string
            [value_1] =&gt; 100
            [value_2] =&gt; 200
        )
</code></pre>

<p>What I'm looking to do is create this format instead, so I can access data within it by writing something like <code>$data['dimension']['key']</code>:</p>

<pre><code>Array
(
    [string] =&gt; Array
        (
            [dimension] =&gt; string
            [value_1] =&gt; 100
            [value_2] =&gt; 200
        )
</code></pre>

<p>Is there a clean way to do this, or should I start playing with loops?</p>
