Associative array - change position
<p>For ex have this array:</p>

<pre><code>[food] =&gt; Array (
    [fruits] =&gt; apple
    [vegetables] =&gt; garlic
    [nuts] =&gt; cashew
    [meat] =&gt; beaf
)
</code></pre>

<p>I need to change the position of a specific key-value combination.</p>

<p>Let's say I need to move  [fruits] => apple to 3rd position</p>

<pre><code>[food] =&gt; Array (
    [vegetables] =&gt; garlic
    [nuts] =&gt; cashew
    [fruits] =&gt; apple
    [meat] =&gt; beaf
)
</code></pre>

<p>I am not talking about sorting by key or value.
I need to change position of key-value to a very strict new position.</p>

<p>Something like:</p>

<pre><code>change_pos($my_arr, $key_to_move, $new_index);
</code></pre>

<p>=></p>

<pre><code>change_pos($my_arr, "fruits", 3);
</code></pre>

<p>Is that possible?</p>
